diff options
| author | Fuwn <[email protected]> | 2022-06-02 04:04:27 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-02 04:04:27 +0000 |
| commit | 96c139a26a94cf0fd4d531df3c07156b3b531568 (patch) | |
| tree | ed2f288d32a8a69947f3a67bfa437021015e5f05 /tests/ast.rs | |
| parent | docs(cargo): bump version to 0.2.3 (diff) | |
| download | germ-96c139a26a94cf0fd4d531df3c07156b3b531568.tar.xz germ-96c139a26a94cf0fd4d531df3c07156b3b531568.zip | |
feat(germ): ast struct
Diffstat (limited to 'tests/ast.rs')
| -rw-r--r-- | tests/ast.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/ast.rs b/tests/ast.rs index 2fbc1d3..8b3882d 100644 --- a/tests/ast.rs +++ b/tests/ast.rs @@ -18,12 +18,12 @@ #[cfg(test)] mod test { - use germ::ast::{build, Node}; + use germ::ast::{Ast, Node}; #[test] fn build_multi_line_list_with_text() { assert_eq!( - build("* item1\n* 2\nhi text"), + *Ast::from_string("* item1\n* 2\nhi text").inner(), vec![ Node::List(vec!["item1".to_string(), "2".to_string()]), Node::Text("hi text".to_string()), @@ -34,7 +34,7 @@ mod test { #[test] fn build_multi_line_vec() { assert_eq!( - build("=> /test hi\nhi there\n> hi"), + *Ast::from_string("=> /test hi\nhi there\n> hi").inner(), vec![ Node::Link { to: "/test".to_string(), @@ -49,8 +49,8 @@ mod test { #[test] fn build_single_0th_from_vec() { assert_eq!( - build("=> /test hi"), - vec![Node::Link { + Ast::from_string("=> /test hi").inner(), + &vec![Node::Link { to: "/test".to_string(), text: Some("hi".to_string()), }], @@ -60,7 +60,7 @@ mod test { #[test] fn build_single_element() { assert_eq!( - build("=> /test hi").get(0).unwrap(), + Ast::from_string("=> /test hi").inner().get(0).unwrap(), &Node::Link { to: "/test".to_string(), text: Some("hi".to_string()), |