From d611ad3325f66eaf83464bbd5ef4de74c0623db9 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 9 Aug 2022 10:47:31 +0200 Subject: Add some more tests for just line endings --- tests/misc_line_ending.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests/misc_line_ending.rs') 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 @@ -9,6 +9,42 @@ fn line_ending() { ..Options::default() }; + 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"), "

a\nb

", -- cgit