Skip to content

Commit 2f61848

Browse files
committed
Add pp test for interleaving comments through vectors. Closes #679
1 parent 89df915 commit 2f61848

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

src/test/pretty/vec-comments.pp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Issue #679
2+
// Testing that comments are correctly interleaved
3+
// pp-exact:vec-comments.pp
4+
fn main() {
5+
let v1 =
6+
~[
7+
// Comment
8+
0,
9+
// Comment
10+
1,
11+
// Comment
12+
2];
13+
let v2 =
14+
~[0, // Comment
15+
1, // Comment
16+
2]; // Comment
17+
let v3 =
18+
~[
19+
/* Comment */
20+
0,
21+
/* Comment */
22+
1,
23+
/* Comment */
24+
2];
25+
let v4 =
26+
~[0, /* Comment */
27+
1, /* Comment */
28+
2]; /* Comment */
29+
}

src/test/pretty/vec-comments.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Issue #679
2+
// Testing that comments are correctly interleaved
3+
// pp-exact:vec-comments.pp
4+
fn main() {
5+
let v1 = ~[
6+
// Comment
7+
0,
8+
// Comment
9+
1,
10+
// Comment
11+
2
12+
];
13+
let v2 = ~[
14+
0, // Comment
15+
1, // Comment
16+
2 // Comment
17+
];
18+
let v3 = ~[
19+
/* Comment */
20+
0,
21+
/* Comment */
22+
1,
23+
/* Comment */
24+
2
25+
];
26+
let v4 = ~[
27+
0, /* Comment */
28+
1, /* Comment */
29+
2 /* Comment */
30+
];
31+
}

0 commit comments

Comments
 (0)