rust/src/test/run-pass/raw-str.rs
Alex Crichton 39e2c69541 syntax: Remove deprecated unicode escapes
These have been deprecated for quite some time, so we should be good to remove
them now.
2015-03-06 14:11:09 -08:00

38 lines
1.3 KiB
Rust
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-lexer-test FIXME #15679
// ignore-tidy-tab
// ignore-tidy-linelength
pub fn main() {
assert_eq!(r"abc", "abc");
assert_eq!(r#"abc"#, "abc");
assert_eq!(r"###", "###");
assert_eq!(r"\", "\\");
assert_eq!(r#"\""#, "\\\"");
assert_eq!(r#"#"\n""#, "#\"\\n\"");
assert_eq!(r##"a"#"b"##, "a\"#\"b");
// from rust.vim
assert_eq!(r#""%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)""#,
"\"%\\(\\d\\+\\$\\)\\=[-+' #0*]*\\(\\d*\\|\\*\\|\\*\\d\\+\\$\\)\\(\\.\\(\\d*\\|\\*\\|\\*\\d\\+\\$\\)\\)\\=\\([hlLjzt]\\|ll\\|hh\\)\\=\\([aAbdiuoxXDOUfFeEgGcCsSpn?]\\|\\[\\^\\=.[^]]*\\]\\)\"");
assert_eq!(r"newline:'
', tab:' ', unicode:'●', null:''",
"newline:'\n', tab:'\t', unicode:'\u{25cf}', null:'\0'");
}