2019-07-26 16:54:25 -05:00
|
|
|
// run-pass
|
2014-05-24 03:13:59 -05:00
|
|
|
// ignore-tidy-cr ignore-license
|
|
|
|
// ignore-tidy-cr (repeated again because of tidy bug)
|
|
|
|
// license is ignored because tidy can't handle the CRLF here properly.
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2018-11-26 20:59:49 -06:00
|
|
|
// N.B., this file needs CRLF line endings. The .gitattributes file in
|
2014-05-24 03:13:59 -05:00
|
|
|
// this directory should enforce it.
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2016-10-12 12:54:41 -05:00
|
|
|
// ignore-pretty issue #37195
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
/// Doc comment that ends in CRLF
|
|
|
|
pub fn foo() {}
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
/** Block doc comment that
|
|
|
|
* contains CRLF characters
|
|
|
|
*/
|
|
|
|
pub fn bar() {}
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
fn main() {
|
|
|
|
let s = "string
|
|
|
|
literal";
|
|
|
|
assert_eq!(s, "string\nliteral");
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
let s = "literal with \
|
|
|
|
escaped newline";
|
|
|
|
assert_eq!(s, "literal with escaped newline");
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
let s = r"string
|
|
|
|
literal";
|
|
|
|
assert_eq!(s, "string\nliteral");
|
2019-06-09 07:15:31 -05:00
|
|
|
let s = br"byte string
|
|
|
|
literal";
|
|
|
|
assert_eq!(s, "byte string\nliteral".as_bytes());
|
2015-10-06 20:59:49 -05:00
|
|
|
|
2014-05-24 03:13:59 -05:00
|
|
|
// validate that our source file has CRLF endings
|
|
|
|
let source = include_str!("lexer-crlf-line-endings-string-literal-doc-comment.rs");
|
|
|
|
assert!(source.contains("string\r\nliteral"));
|
|
|
|
}
|