Skip to content

Commit b03a0b2

Browse files
committed
make pp file conform to actual output, noting some oddities along the way.
1 parent 0f4d5c2 commit b03a0b2

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

src/test/pretty/block-comment-wchar.pp

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,30 +81,36 @@
8181
Mongolian Vowel Sep count F: (should align)
8282
*/
8383

84-
/* */ /*
85-
Hello from offset 6
86-
Space 6+2: compare A
87-
Mongolian Vowel Separator 6+2: compare B
88-
*/
89-
/*᠎*/ /*
90-
Hello from another offset 6 with wchars establishing column offset
91-
Space 6+2: compare C
92-
Mongolian Vowel Separator 6+2: compare D
93-
*/
84+
85+
86+
/* */
87+
88+
/*
89+
Hello from offset 6
90+
Space 6+2: compare A
91+
Mongolian Vowel Separator 6+2: compare B
92+
*/
93+
94+
/*᠎*/
95+
96+
/*
97+
Hello from another offset 6 with wchars establishing column offset
98+
Space 6+2: compare C
99+
Mongolian Vowel Separator 6+2: compare D
100+
*/
94101
}
95102

96103
fn main() {
97104
// Taken from http://en.wikipedia.org/wiki/Whitespace_character
98-
let chars = [ '\x0A', '\x0B', '\x0C', '\x0D', '\x20',
99-
// '\x85', // for some reason Rust thinks NEL isn't whitespace
100-
'\xA0', '\u1680', '\u180E',
101-
'\u2000', '\u2001', '\u2002', '\u2003',
102-
'\u2004', '\u2005', '\u2006', '\u2007',
103-
'\u2008', '\u2009', '\u200A',
104-
'\u2028', '\u2029', '\u202F', '\u205F',
105-
'\u3000'
106-
];
105+
let chars =
106+
['\x0A', '\x0B', '\x0C', '\x0D', '\x20',
107+
// '\x85', // for some reason Rust thinks NEL isn't whitespace
108+
'\xA0', '\u1680', '\u180E', '\u2000', '\u2001', '\u2002', '\u2003',
109+
'\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200A',
110+
'\u2028', '\u2029', '\u202F', '\u205F', '\u3000'];
111+
// <= bugs in pretty-printer?
107112
for vec::each(chars) |c| {
108-
io::println(fmt!("%? %?", c, c.is_whitespace()));
113+
let ws = c.is_whitespace();
114+
io::println(fmt!("%? %?" , c , ws));
109115
}
110116
}

src/test/pretty/block-comment-wchar.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ fn f() {
8181
᠎᠎᠎᠎ Mongolian Vowel Sep count F: (should align)
8282
*/
8383

84+
8485
/* */ /*
8586
Hello from offset 6
8687
Space 6+2: compare A
@@ -95,16 +96,14 @@ fn f() {
9596

9697
fn main() {
9798
// Taken from http://en.wikipedia.org/wiki/Whitespace_character
98-
let chars = [ '\x0A', '\x0B', '\x0C', '\x0D', '\x20',
99-
// '\x85', // for some reason Rust thinks NEL isn't whitespace
100-
'\xA0', '\u1680', '\u180E',
101-
'\u2000', '\u2001', '\u2002', '\u2003',
102-
'\u2004', '\u2005', '\u2006', '\u2007',
103-
'\u2008', '\u2009', '\u200A',
104-
'\u2028', '\u2029', '\u202F', '\u205F',
105-
'\u3000'
106-
];
99+
let chars =
100+
['\x0A', '\x0B', '\x0C', '\x0D', '\x20',
101+
// '\x85', // for some reason Rust thinks NEL isn't whitespace
102+
'\xA0', '\u1680', '\u180E', '\u2000', '\u2001', '\u2002', '\u2003',
103+
'\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200A',
104+
'\u2028', '\u2029', '\u202F', '\u205F', '\u3000'];
107105
for vec::each(chars) |c| {
108-
io::println(fmt!("%? %?", c, c.is_whitespace()));
106+
let ws = c.is_whitespace();
107+
io::println(fmt!("%? %?", c , ws)); // <= bugs in pretty-printer?
109108
}
110109
}

0 commit comments

Comments
 (0)