diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-06 13:57:44 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-06 14:11:09 -0800 |
| commit | 39e2c6954171fafeabf29a71fba96f161577d9fa (patch) | |
| tree | 5933b51e21c07337f30540cb0f4daa4567e42e33 /src/test | |
| parent | 1fe8f221450bad3ffb1351c6549f67c18ce0b94e (diff) | |
| download | rust-39e2c6954171fafeabf29a71fba96f161577d9fa.tar.gz rust-39e2c6954171fafeabf29a71fba96f161577d9fa.zip | |
syntax: Remove deprecated unicode escapes
These have been deprecated for quite some time, so we should be good to remove them now.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/parse-fail/lex-bad-char-literals.rs | 22 | ||||
| -rw-r--r-- | src/test/pretty/block-comment-wchar.pp | 9 | ||||
| -rw-r--r-- | src/test/pretty/block-comment-wchar.rs | 9 | ||||
| -rw-r--r-- | src/test/run-pass/nul-characters.rs | 12 | ||||
| -rw-r--r-- | src/test/run-pass/raw-str.rs | bin | 1339 -> 1341 bytes | |||
| -rw-r--r-- | src/test/run-pass/utf8.rs | 10 | ||||
| -rw-r--r-- | src/test/run-pass/utf8_chars.rs | 2 |
7 files changed, 22 insertions, 42 deletions
diff --git a/src/test/parse-fail/lex-bad-char-literals.rs b/src/test/parse-fail/lex-bad-char-literals.rs index fbe03e355ee..4aa01bcde69 100644 --- a/src/test/parse-fail/lex-bad-char-literals.rs +++ b/src/test/parse-fail/lex-bad-char-literals.rs @@ -8,36 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static c: char = - '\u539_' //~ ERROR: illegal character in numeric character escape - //~^ WARNING: \uABCD escapes are deprecated -; - -static c2: char = - '\Uffffffff' //~ ERROR: illegal numeric character escape - //~^ WARNING: \uABCD escapes are deprecated -; - static c3: char = '\x1' //~ ERROR: numeric character escape is too short ; -static c4: char = - '\u23q' //~ ERROR: illegal character in numeric character escape - //~^ WARNING: \uABCD escapes are deprecated -; -//~^^^ ERROR: numeric character escape is too short - static s: &'static str = "\x1" //~ ERROR: numeric character escape is too short ; -static s2: &'static str = - "\u23q" //~ ERROR: illegal character in numeric character escape - //~^ ERROR: numeric character escape is too short - //~^^ WARNING: \uABCD escapes are deprecated -; - static c: char = '\●' //~ ERROR: unknown character escape ; diff --git a/src/test/pretty/block-comment-wchar.pp b/src/test/pretty/block-comment-wchar.pp index 5a55cb4e561..a5d82277d2f 100644 --- a/src/test/pretty/block-comment-wchar.pp +++ b/src/test/pretty/block-comment-wchar.pp @@ -105,10 +105,11 @@ fn f() { fn main() { // Taken from http://www.unicode.org/Public/UNIDATA/PropList.txt let chars = - ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u0085', '\u00A0', '\u1680', - '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', - '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', - '\u205F', '\u3000']; + ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u{85}', '\u{A0}', + '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}', + '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}', + '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}', + '\u{205F}', '\u{3000}']; for c in &chars { let ws = c.is_whitespace(); println!("{} {}" , c , ws); diff --git a/src/test/pretty/block-comment-wchar.rs b/src/test/pretty/block-comment-wchar.rs index c82bdcd8dcb..eb6d2a4a0a1 100644 --- a/src/test/pretty/block-comment-wchar.rs +++ b/src/test/pretty/block-comment-wchar.rs @@ -99,10 +99,11 @@ fn f() { fn main() { // Taken from http://www.unicode.org/Public/UNIDATA/PropList.txt let chars = - ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u0085', '\u00A0', '\u1680', - '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', - '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', - '\u205F', '\u3000']; + ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u{85}', '\u{A0}', + '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}', + '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}', + '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}', + '\u{205F}', '\u{3000}']; for c in &chars { let ws = c.is_whitespace(); println!("{} {}", c , ws); diff --git a/src/test/run-pass/nul-characters.rs b/src/test/run-pass/nul-characters.rs index 22786c0abc8..4a14969209f 100644 --- a/src/test/run-pass/nul-characters.rs +++ b/src/test/run-pass/nul-characters.rs @@ -10,10 +10,10 @@ pub fn main() { - let all_nuls1 = "\0\x00\u0000\U00000000"; - let all_nuls2 = "\U00000000\u0000\x00\0"; - let all_nuls3 = "\u0000\U00000000\x00\0"; - let all_nuls4 = "\x00\u0000\0\U00000000"; + let all_nuls1 = "\0\x00\u{0}\u{0}"; + let all_nuls2 = "\u{0}\u{0}\x00\0"; + let all_nuls3 = "\u{0}\u{0}\x00\0"; + let all_nuls4 = "\x00\u{0}\0\u{0}"; // sizes for two should suffice assert_eq!(all_nuls1.len(), 4); @@ -35,8 +35,8 @@ pub fn main() // testing equality between explicit character literals assert_eq!('\0', '\x00'); - assert_eq!('\u0000', '\x00'); - assert_eq!('\u0000', '\U00000000'); + assert_eq!('\u{0}', '\x00'); + assert_eq!('\u{0}', '\u{0}'); // NUL characters should make a difference assert!("Hello World" != "Hello \0World"); diff --git a/src/test/run-pass/raw-str.rs b/src/test/run-pass/raw-str.rs index 35e863d05a1..298ac8f77eb 100644 --- a/src/test/run-pass/raw-str.rs +++ b/src/test/run-pass/raw-str.rs Binary files differdiff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index 96bba01068f..4be54bd7080 100644 --- a/src/test/run-pass/utf8.rs +++ b/src/test/run-pass/utf8.rs @@ -24,7 +24,7 @@ pub fn main() { assert_eq!(y_diaeresis as int, 0xff); assert_eq!(pi as int, 0x3a0); - assert_eq!(pi as int, '\u03a0' as int); + assert_eq!(pi as int, '\u{3a0}' as int); assert_eq!('\x0a' as int, '\n' as int); let bhutan: String = "འབྲུག་ཡུལ།".to_string(); @@ -33,11 +33,11 @@ pub fn main() { let austria: String = "Österreich".to_string(); let bhutan_e: String = - "\u0f60\u0f56\u0fb2\u0f74\u0f42\u0f0b\u0f61\u0f74\u0f63\u0f0d".to_string(); - let japan_e: String = "\u65e5\u672c".to_string(); + "\u{f60}\u{f56}\u{fb2}\u{f74}\u{f42}\u{f0b}\u{f61}\u{f74}\u{f63}\u{f0d}".to_string(); + let japan_e: String = "\u{65e5}\u{672c}".to_string(); let uzbekistan_e: String = - "\u040e\u0437\u0431\u0435\u043a\u0438\u0441\u0442\u043e\u043d".to_string(); - let austria_e: String = "\u00d6sterreich".to_string(); + "\u{40e}\u{437}\u{431}\u{435}\u{43a}\u{438}\u{441}\u{442}\u{43e}\u{43d}".to_string(); + let austria_e: String = "\u{d6}sterreich".to_string(); let oo: char = 'Ö'; assert_eq!(oo as int, 0xd6); diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs index 88369f2e500..c54b3b69c68 100644 --- a/src/test/run-pass/utf8_chars.rs +++ b/src/test/run-pass/utf8_chars.rs @@ -14,7 +14,7 @@ use std::str; pub fn main() { // Chars of 1, 2, 3, and 4 bytes - let chs: Vec<char> = vec!('e', 'é', '€', '\U00010000'); + let chs: Vec<char> = vec!('e', 'é', '€', '\u{10000}'); let s: String = chs.iter().cloned().collect(); let schs: Vec<char> = s.chars().collect(); |
