Created
September 9, 2018 22:34
-
-
Save lthms/cc2a6da3e2aace8b9888a25b24e70885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_document() { | |
assert_eq!( | |
document(r#"She opened the letter, and read it. | |
_____letter____ | |
Dear friend. | |
I love you. | |
_______________"#), | |
Ok( | |
( | |
"", | |
Document( | |
vec![ | |
Section::Story( | |
vec![ | |
Paragraph( | |
vec![ | |
Component::Teller( | |
vec![ | |
Format::Raw( | |
vec![ | |
Atom::Word("She"), | |
Atom::Word("opened"), | |
Atom::Word("the"), | |
Atom::Word("letter"), | |
Atom::Punctuation(Mark::Comma), | |
Atom::Word("and"), | |
Atom::Word("read"), | |
Atom::Word("it"), | |
Atom::Punctuation(Mark::Point) | |
] | |
) | |
] | |
) | |
] | |
) | |
] | |
), | |
Section::Aside( | |
Some("letter"), | |
vec![ | |
Paragraph( | |
vec![ | |
Component::Teller( | |
vec![ | |
Format::Raw( | |
vec![ | |
Atom::Word("Dear"), | |
Atom::Word("friend"), | |
Atom::Punctuation(Mark::Point) | |
] | |
) | |
] | |
) | |
] | |
), | |
Paragraph( | |
vec![ | |
Component::Teller( | |
vec![ | |
Format::Raw( | |
vec![ | |
Atom::Word("I"), | |
Atom::Word("love"), | |
Atom::Word("you"), | |
Atom::Punctuation(Mark::Point) | |
] | |
) | |
] | |
) | |
] | |
) | |
] | |
) | |
] | |
) | |
) | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment