aboutsummaryrefslogtreecommitdiff
path: root/tests/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ast.rs')
-rw-r--r--tests/ast.rs43
1 files changed, 14 insertions, 29 deletions
diff --git a/tests/ast.rs b/tests/ast.rs
index 7c6dc36..6d1f545 100644
--- a/tests/ast.rs
+++ b/tests/ast.rs
@@ -51,49 +51,34 @@ That was a link without text."#;
#[test]
fn build_multi_line_list_with_text() {
- assert_eq!(
- *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()),
- ],
- );
+ assert_eq!(*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()),
+ ],);
}
#[test]
fn build_multi_line_vec() {
- assert_eq!(
- *Ast::from_string("=> /test hi\nhi there\n> hi").inner(),
- vec![
- Node::Link {
- to: "/test".to_string(),
- text: Some("hi".to_string()),
- },
- Node::Text("hi there".to_string()),
- Node::Blockquote("hi".to_string()),
- ],
- );
+ assert_eq!(*Ast::from_string("=> /test hi\nhi there\n> hi").inner(), vec![
+ Node::Link { to: "/test".to_string(), text: Some("hi".to_string()) },
+ Node::Text("hi there".to_string()),
+ Node::Blockquote("hi".to_string()),
+ ],);
}
#[test]
fn build_single_0th_from_vec() {
- assert_eq!(
- Ast::from_string("=> /test hi").inner(),
- &vec![Node::Link {
- to: "/test".to_string(),
- text: Some("hi".to_string()),
- }],
- );
+ assert_eq!(Ast::from_string("=> /test hi").inner(), &vec![Node::Link {
+ to: "/test".to_string(),
+ text: Some("hi".to_string()),
+ }],);
}
#[test]
fn build_single_element() {
assert_eq!(
Ast::from_string("=> /test hi").inner().get(0).unwrap(),
- &Node::Link {
- to: "/test".to_string(),
- text: Some("hi".to_string()),
- },
+ &Node::Link { to: "/test".to_string(), text: Some("hi".to_string()) },
);
}