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