Emphasis test

This commit is contained in:
Alex Bethel 2021-11-27 21:29:10 -07:00
parent 4d97dcba1a
commit 18b1cc9d7f

View file

@ -145,4 +145,56 @@ New paragraph",
assert_eq!(doc, doc_ref);
}
/// Italics and bold.
#[test]
fn emphasis() {
let doc = parse("Normal *italics* **bold** ***both***");
let doc_ref = Document(vec![Node::Paragraph(vec![
StyledText {
italic: false,
bold: false,
underline: false,
color: None,
text: "Normal ".to_string(),
},
StyledText {
italic: true,
bold: false,
underline: false,
color: None,
text: "italics".to_string(),
},
StyledText {
italic: false,
bold: false,
underline: false,
color: None,
text: " ".to_string(),
},
StyledText {
italic: false,
bold: true,
underline: false,
color: None,
text: "bold".to_string(),
},
StyledText {
italic: false,
bold: false,
underline: false,
color: None,
text: " ".to_string(),
},
StyledText {
italic: true,
bold: true,
underline: false,
color: None,
text: "both".to_string(),
},
])]);
assert_eq!(doc, doc_ref);
}
}