Add regression test for include_str! normalization
This commit is contained in:
parent
66dc08ad60
commit
14bc998df9
1
src/test/ui/.gitattributes
vendored
1
src/test/ui/.gitattributes
vendored
@ -1,2 +1,3 @@
|
||||
lexer-crlf-line-endings-string-literal-doc-comment.rs -text
|
||||
trailing-carriage-return-in-string.rs -text
|
||||
*.bin -text
|
||||
|
2
src/test/ui/include-macros/data.bin
Normal file
2
src/test/ui/include-macros/data.bin
Normal file
@ -0,0 +1,2 @@
|
||||
This file starts with BOM.
|
||||
Lines are separated by \r\n.
|
12
src/test/ui/include-macros/normalization.rs
Normal file
12
src/test/ui/include-macros/normalization.rs
Normal 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",
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user