From 2f61848b24bcb04f4eee3bd16851d3e654d66e20 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 16 Aug 2011 11:37:35 -0700 Subject: [PATCH] Add pp test for interleaving comments through vectors. Closes #679 --- src/test/pretty/vec-comments.pp | 29 +++++++++++++++++++++++++++++ src/test/pretty/vec-comments.rs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/test/pretty/vec-comments.pp create mode 100644 src/test/pretty/vec-comments.rs diff --git a/src/test/pretty/vec-comments.pp b/src/test/pretty/vec-comments.pp new file mode 100644 index 000000000000..c6e78aef878f --- /dev/null +++ b/src/test/pretty/vec-comments.pp @@ -0,0 +1,29 @@ +// Issue #679 +// Testing that comments are correctly interleaved +// pp-exact:vec-comments.pp +fn main() { + let v1 = + ~[ + // Comment + 0, + // Comment + 1, + // Comment + 2]; + let v2 = + ~[0, // Comment + 1, // Comment + 2]; // Comment + let v3 = + ~[ + /* Comment */ + 0, + /* Comment */ + 1, + /* Comment */ + 2]; + let v4 = + ~[0, /* Comment */ + 1, /* Comment */ + 2]; /* Comment */ +} diff --git a/src/test/pretty/vec-comments.rs b/src/test/pretty/vec-comments.rs new file mode 100644 index 000000000000..48de34972b7f --- /dev/null +++ b/src/test/pretty/vec-comments.rs @@ -0,0 +1,31 @@ +// Issue #679 +// Testing that comments are correctly interleaved +// pp-exact:vec-comments.pp +fn main() { + let v1 = ~[ + // Comment + 0, + // Comment + 1, + // Comment + 2 + ]; + let v2 = ~[ + 0, // Comment + 1, // Comment + 2 // Comment + ]; + let v3 = ~[ + /* Comment */ + 0, + /* Comment */ + 1, + /* Comment */ + 2 + ]; + let v4 = ~[ + 0, /* Comment */ + 1, /* Comment */ + 2 /* Comment */ + ]; +}