]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lexer-crlf-line-endings-string-literal-doc-comment.rs
Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obk
[rust.git] / src / test / ui / lexer-crlf-line-endings-string-literal-doc-comment.rs
1 // run-pass\r
2 // ignore-tidy-cr ignore-license\r
3 // ignore-tidy-cr (repeated again because of tidy bug)\r
4 // license is ignored because tidy can't handle the CRLF here properly.\r
5 \r
6 // http://rust-lang.org/COPYRIGHT.\r
7 //\r
8 \r
9 // N.B., this file needs CRLF line endings. The .gitattributes file in\r
10 // this directory should enforce it.\r
11 \r
12 // ignore-pretty issue #37195\r
13 \r
14 /// Doc comment that ends in CRLF\r
15 pub fn foo() {}\r
16 \r
17 /** Block doc comment that\r
18  *  contains CRLF characters\r
19  */\r
20 pub fn bar() {}\r
21 \r
22 fn main() {\r
23     let s = "string\r
24 literal";\r
25     assert_eq!(s, "string\nliteral");\r
26 \r
27     let s = "literal with \\r
28              escaped newline";\r
29     assert_eq!(s, "literal with escaped newline");\r
30 \r
31     let s = r"string\r
32 literal";\r
33     assert_eq!(s, "string\nliteral");\r
34     let s = br"byte string\r
35 literal";\r
36     assert_eq!(s, "byte string\nliteral".as_bytes());\r
37 \r
38     // validate that our source file has CRLF endings\r
39     let source = include_str!("lexer-crlf-line-endings-string-literal-doc-comment.rs");\r
40     assert!(source.contains("string\r\nliteral"));\r
41 }\r