use utf16_lit::utf16_null; #[test] fn test_example() { let normal: Vec = "example".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("example")); } #[test] fn test_tab() { let normal: Vec = "\t".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\t")); } #[test] fn test_newline() { let normal: Vec = "\n".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\n")); } #[test] fn test_carriage_return() { let normal: Vec = "\r".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\r")); } #[test] fn test_backslash() { let normal: Vec = "\\".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\\")); } #[test] fn test_null() { let normal: Vec = "\0".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\0")); } #[test] fn test_single_quote() { let normal: Vec = "\'".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\'")); } #[test] fn test_double_quote() { let normal: Vec = "\"".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\"")); } #[test] fn test_escaped_ascii() { let normal: Vec = "\x52".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\x52")); } #[test] fn test_escaped_unicode() { let normal: Vec = "\u{00B6}".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!("\u{00B6}")); } #[test] fn test_raw_string() { let normal: Vec = r"\".encode_utf16().chain(Some(0)).collect(); assert_eq!(normal, utf16_null!(r"\")); assert_eq!(normal, utf16_null!(r#"\"#)); assert_eq!(normal, utf16_null!(r##"\"##)); }