extern crate micromark; use micromark::micromark; use pretty_assertions::assert_eq; #[test] fn zero() -> Result<(), String> { assert_eq!(micromark(""), "", "should support no markdown"); assert_eq!( micromark("asd\0asd"), "

asd�asd

", "should replace `\\0` w/ a replacement characters (`�`)" ); assert_eq!( micromark("�"), "

", "should replace NUL in a character reference" ); // This doesn’t make sense in markdown, as character escapes only work on // ascii punctuation, but it’s good to demonstrate the behavior. assert_eq!( micromark("\\0"), "

\\0

", "should not support NUL in a character escape" ); Ok(()) }