aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-09 10:47:31 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-09 10:47:31 +0200
commitd611ad3325f66eaf83464bbd5ef4de74c0623db9 (patch)
tree282f8934fcf63278349ab2c75c20640de936c2ac
parent4ce1ac9e41cafa9051377470e8a246063f7d9b1a (diff)
downloadmarkdown-rs-d611ad3325f66eaf83464bbd5ef4de74c0623db9.tar.gz
markdown-rs-d611ad3325f66eaf83464bbd5ef4de74c0623db9.tar.bz2
markdown-rs-d611ad3325f66eaf83464bbd5ef4de74c0623db9.zip
Add some more tests for just line endings
-rw-r--r--tests/misc_line_ending.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/misc_line_ending.rs b/tests/misc_line_ending.rs
index f6dbccd..3d8934d 100644
--- a/tests/misc_line_ending.rs
+++ b/tests/misc_line_ending.rs
@@ -10,6 +10,42 @@ fn line_ending() {
};
assert_eq!(
+ micromark("\n"),
+ "",
+ "should support just a line feed"
+ );
+
+ assert_eq!(
+ micromark("\r"),
+ "",
+ "should support just a carriage return"
+ );
+
+ assert_eq!(
+ micromark("\r\n"),
+ "",
+ "should support just a carriage return + line feed"
+ );
+
+ assert_eq!(
+ micromark("\n\n"),
+ "",
+ "should support just two line feeds"
+ );
+
+ assert_eq!(
+ micromark("\r\r"),
+ "",
+ "should support just two carriage return"
+ );
+
+ assert_eq!(
+ micromark("\r\n\r\n"),
+ "",
+ "should support just two carriage return + line feeds"
+ );
+
+ assert_eq!(
micromark("a\nb"),
"<p>a\nb</p>",
"should support a line feed for a line ending inside a paragraph"