test: fix issue_22
This commit is contained in:
parent
db6a827de2
commit
b6e86a128a
1 changed files with 4 additions and 20 deletions
|
|
@ -1,24 +1,8 @@
|
|||
use orgize::Org;
|
||||
use orgize::{ast::Paragraph, rowan::ast::AstNode, Org};
|
||||
|
||||
#[test]
|
||||
fn whitespaces() {
|
||||
let org = Org::parse(" ");
|
||||
|
||||
assert(&org);
|
||||
|
||||
let org = Org::parse("\t \t \n \t \t \n \t");
|
||||
|
||||
assert(&org);
|
||||
|
||||
let org = Org::parse("\u{000b}\u{0085}\u{00a0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}");
|
||||
|
||||
assert(&org);
|
||||
}
|
||||
|
||||
fn assert(org: &Org) {
|
||||
assert_eq!(
|
||||
org.iter().count(),
|
||||
2,
|
||||
"should contains only one element - document"
|
||||
);
|
||||
let case = "\u{000b}\u{0085}\u{00a0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}";
|
||||
let paragraph = Org::parse(case).first_node::<Paragraph>().unwrap();
|
||||
assert_eq!(¶graph.syntax().to_string(), case);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue