|
| 1 | +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution and at |
| 3 | +// http://rust-lang.org/COPYRIGHT. |
| 4 | +// |
| 5 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | +// option. This file may not be copied, modified, or distributed |
| 9 | +// except according to those terms. |
| 10 | + |
| 11 | +// This is meant as a test case for Issue 3961. |
| 12 | +// |
| 13 | +// Test via: rustc --pretty normal src/test/pretty/block-comment-wchar.rs |
| 14 | + |
| 15 | +fn f() { |
| 16 | + fn nested() { |
| 17 | + /* |
| 18 | + Spaced2 |
| 19 | + */ |
| 20 | + /* |
| 21 | + Spaced10 |
| 22 | + */ |
| 23 | + /* |
| 24 | + Tabbed8+2 |
| 25 | + */ |
| 26 | + /* |
| 27 | + CR8+2 |
| 28 | + */ |
| 29 | + } |
| 30 | + /* |
| 31 | + Spaced2: (prefixed so start of space aligns with comment) |
| 32 | + */ |
| 33 | + /* |
| 34 | + Tabbed2: (more indented b/c *start* of space will align with comment) |
| 35 | + */ |
| 36 | + /* |
| 37 | + Spaced6: (Alignment removed and realigning spaces inserted) |
| 38 | + */ |
| 39 | + /* |
| 40 | + Tabbed4+2: (Alignment removed and realigning spaces inserted) |
| 41 | + */ |
| 42 | + |
| 43 | + /* |
| 44 | + VT4+2: (should align) |
| 45 | + */ |
| 46 | + /* |
| 47 | + FF4+2: (should align) |
| 48 | + */ |
| 49 | + /* |
| 50 | + CR4+2: (should align) |
| 51 | + */ |
| 52 | + /* |
| 53 | + // (NEL deliberately omitted) |
| 54 | + */ |
| 55 | + /* |
| 56 | + Ogham Space Mark 4+2: (should align) |
| 57 | + */ |
| 58 | + /* |
| 59 | + Mongolian Vowel Separator 4+2: (should align) |
| 60 | + */ |
| 61 | + /* |
| 62 | + Four-per-em space 4+2: (should align) |
| 63 | + */ |
| 64 | + |
| 65 | + /* |
| 66 | + Mongolian Vowel Sep count 1: (should align) |
| 67 | + Mongolian Vowel Sep count 2: (should align) |
| 68 | + Mongolian Vowel Sep count 3: (should align) |
| 69 | + Mongolian Vowel Sep count 4: (should align) |
| 70 | + Mongolian Vowel Sep count 5: (should align) |
| 71 | + Mongolian Vowel Sep count 6: (should align) |
| 72 | + Mongolian Vowel Sep count 7: (should align) |
| 73 | + Mongolian Vowel Sep count 8: (should align) |
| 74 | + Mongolian Vowel Sep count 9: (should align) |
| 75 | + Mongolian Vowel Sep count A: (should align) |
| 76 | + Mongolian Vowel Sep count B: (should align) |
| 77 | + Mongolian Vowel Sep count C: (should align) |
| 78 | + Mongolian Vowel Sep count D: (should align) |
| 79 | + Mongolian Vowel Sep count E: (should align) |
| 80 | + Mongolian Vowel Sep count F: (should align) |
| 81 | + */ |
| 82 | + |
| 83 | +/* */ /* |
| 84 | + Hello from offset 6 |
| 85 | + Space 6+2: compare A |
| 86 | + Mongolian Vowel Separator 6+2: compare B |
| 87 | + */ |
| 88 | +/**/ /* |
| 89 | + Hello from another offset 6 with wchars establishing column offset |
| 90 | + Space 6+2: compare C |
| 91 | + Mongolian Vowel Separator 6+2: compare D |
| 92 | + */ |
| 93 | +} |
| 94 | + |
| 95 | +fn main() { |
| 96 | + // Taken from http://en.wikipedia.org/wiki/Whitespace_character |
| 97 | + let chars = [ '\x0A', '\x0B', '\x0C', '\x0D', '\x20', |
| 98 | + // '\x85', // for some reason Rust thinks NEL isn't whitespace |
| 99 | + '\xA0', '\u1680', '\u180E', |
| 100 | + '\u2000', '\u2001', '\u2002', '\u2003', |
| 101 | + '\u2004', '\u2005', '\u2006', '\u2007', |
| 102 | + '\u2008', '\u2009', '\u200A', |
| 103 | + '\u2028', '\u2029', '\u202F', '\u205F', |
| 104 | + '\u3000' |
| 105 | + ]; |
| 106 | + for vec::each(chars) |c| { |
| 107 | + io::println(fmt!("%? %?", c, c.is_whitespace())); |
| 108 | + } |
| 109 | +} |
|
0 commit comments