27 lines
538 B
Rust
27 lines
538 B
Rust
use markdown::mdast::{Node, Text};
|
|
use mdast_util_to_markdown::to_markdown as to;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
#[test]
|
|
fn text() {
|
|
assert_eq!(
|
|
to(&Node::Text(Text {
|
|
value: String::new(),
|
|
position: None,
|
|
}))
|
|
.unwrap(),
|
|
"",
|
|
"should support an empty text"
|
|
);
|
|
|
|
assert_eq!(
|
|
to(&Node::Text(Text {
|
|
value: String::from("a\nb"),
|
|
position: None,
|
|
}))
|
|
.unwrap(),
|
|
"a\nb\n",
|
|
"should support text"
|
|
);
|
|
}
|