aboutsummaryrefslogtreecommitdiff
path: root/tests/node.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-19 07:37:57 +0000
committerFuwn <[email protected]>2024-06-19 07:38:02 +0000
commitad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa (patch)
tree69e7405bf5139d0cabd6e2ef890328b0d4cb9bde /tests/node.rs
parentfix(ast): preserve newline structure at end of gemtext (diff)
downloadgerm-ad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa.tar.xz
germ-ad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa.zip
refactor(Node): rename content() to to_gemtext()
This commit adds a `tests/node.rs` file to test `Node::to_gemtext`.
Diffstat (limited to 'tests/node.rs')
-rw-r--r--tests/node.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/node.rs b/tests/node.rs
new file mode 100644
index 0000000..ff224a4
--- /dev/null
+++ b/tests/node.rs
@@ -0,0 +1,14 @@
+#[cfg(test)]
+mod test {
+ #[test]
+ fn node_to_gemtext() {
+ assert_eq!(
+ germ::ast::Node::Link {
+ to: "/faq".to_string(),
+ text: Some("FAQ".to_string())
+ }
+ .to_gemtext(),
+ "=> /faq FAQ",
+ );
+ }
+}