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