]> git.proxmox.com Git - rustc.git/blob - src/test/pretty/block-comment-wchar.rs
New upstream version 1.14.0+dfsg1
[rustc.git] / src / test / pretty / block-comment-wchar.rs
1 // Copyright 2013-2014 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 // ignore-tidy-cr
15 // ignore-tidy-tab
16 // pp-exact:block-comment-wchar.pp
17 fn f() {
18 fn nested() {
19 /*
20 Spaced2
21 */
22 /*
23 Spaced10
24 */
25 /*
26 Tabbed8+2
27 */
28 /*
29 CR8+2
30 */
31 }
32 /*
33 Spaced2: (prefixed so start of space aligns with comment)
34 */
35 /*
36 Tabbed2: (more indented b/c *start* of space will align with comment)
37 */
38 /*
39 Spaced6: (Alignment removed and realigning spaces inserted)
40 */
41 /*
42 Tabbed4+2: (Alignment removed and realigning spaces inserted)
43 */
44
45 /*
46 \v\v\v\v VT4+2: (should align)
47 */
48 /*
49 \f\f\f\f FF4+2: (should align)
50 */
51 /*
52 CR4+2: (should align)
53 */
54 /*
55 \85\85\85\85 NEL4+2: (should align)
56 */
57 /*
58      Ogham Space Mark 4+2: (should align)
59 */
60 /*
61      Ogham Space Mark 4+2: (should align)
62 */
63 /*
64      Four-per-em space 4+2: (should align)
65 */
66
67 /*
68   Ogham Space Mark count 1: (should align)
69   Ogham Space Mark count 2: (should align)
70    Ogham Space Mark count 3: (should align)
71   Ogham Space Mark count 4: (should align)
72     Ogham Space Mark count 5: (should align)
73    Ogham Space Mark count 6: (should align)
74     Ogham Space Mark count 7: (should align)
75   Ogham Space Mark count 8: (should align)
76     Ogham Space Mark count 9: (should align)
77     Ogham Space Mark count A: (should align)
78      Ogham Space Mark count B: (should align)
79    Ogham Space Mark count C: (should align)
80      Ogham Space Mark count D: (should align)
81     Ogham Space Mark count E: (should align)
82      Ogham Space Mark count F: (should align)
83 */
84
85
86 /* */ /*
87 Hello from offset 6
88 Space 6+2: compare A
89        Ogham Space Mark 6+2: compare B
90 */
91 /* */ /*
92 Hello from another offset 6 with wchars establishing column offset
93 Space 6+2: compare C
94        Ogham Space Mark 6+2: compare D
95 */
96 }
97
98 fn main() {
99 // Taken from http://www.unicode.org/Public/UNIDATA/PropList.txt
100 let chars =
101 ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u{85}', '\u{A0}',
102 '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
103 '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
104 '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
105 '\u{205F}', '\u{3000}'];
106 for c in &chars {
107 let ws = c.is_whitespace();
108 println!("{} {}", c , ws);
109 }
110 }