Add regression test for include_str! normalization

This commit is contained in:
Aleksey Kladov 2019-08-15 10:32:52 +03:00
parent 66dc08ad60
commit 14bc998df9
3 changed files with 15 additions and 0 deletions

View File

@ -1,2 +1,3 @@
lexer-crlf-line-endings-string-literal-doc-comment.rs -text
trailing-carriage-return-in-string.rs -text
*.bin -text

View File

@ -0,0 +1,2 @@
This file starts with BOM.
Lines are separated by \r\n.

View File

@ -0,0 +1,12 @@
// run-pass
fn main() {
assert_eq!(
&include_bytes!("data.bin")[..],
&b"\xEF\xBB\xBFThis file starts with BOM.\r\nLines are separated by \\r\\n.\r\n"[..],
);
assert_eq!(
include_str!("data.bin"),
"\u{FEFF}This file starts with BOM.\r\nLines are separated by \\r\\n.\r\n",
);
}