From 21314d11080eb2fc18202cc83af0b6ff21bc99dd Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 27 Aug 2023 13:18:30 -0700 Subject: [PATCH] Add tests showing how comments are handled --- .../type-alias-where-clauses-with-comments.rs | 31 +++++++++++++++ .../type-alias-where-clauses-with-comments.rs | 39 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/source/type-alias-where-clauses-with-comments.rs create mode 100644 tests/target/type-alias-where-clauses-with-comments.rs diff --git a/tests/source/type-alias-where-clauses-with-comments.rs b/tests/source/type-alias-where-clauses-with-comments.rs new file mode 100644 index 00000000000..722ebac47ac --- /dev/null +++ b/tests/source/type-alias-where-clauses-with-comments.rs @@ -0,0 +1,31 @@ +type Foo // comment1 + // interlinear1 +where // comment2 + // interlinear2 +A: B, // comment3 +C: D, // comment4 + // interlinear3 += E; // comment5 + +type Foo // comment6 + // interlinear4 +where// comment7 + // interlinear5 +A: B, // comment8 +C: D, // comment9 + // interlinear6 += E // comment10 + // interlinear7 +where // comment11 + // interlinear8 +F: G, // comment12 +H: I; // comment13 + +type Foo // comment14 + // interlinear9 += E // comment15 + // interlinear10 +where // comment16 + // interlinear11 +F: G,// comment17 +H: I;// comment18 diff --git a/tests/target/type-alias-where-clauses-with-comments.rs b/tests/target/type-alias-where-clauses-with-comments.rs new file mode 100644 index 00000000000..25c38916376 --- /dev/null +++ b/tests/target/type-alias-where-clauses-with-comments.rs @@ -0,0 +1,39 @@ +type Foo +// comment1 +// interlinear1 +where + // comment2 + // interlinear2 + A: B, // comment3 + C: D, // comment4 +// interlinear3 += E; // comment5 + +type Foo +// comment6 +// interlinear4 +where + // comment7 + // interlinear5 + A: B, // comment8 + C: D, // comment9 +// interlinear6 += E +// comment10 +// interlinear7 +where + // comment11 + // interlinear8 + F: G, // comment12 + H: I; // comment13 + +type Foo // comment14 + // interlinear9 + = E +// comment15 +// interlinear10 +where + // comment16 + // interlinear11 + F: G, // comment17 + H: I; // comment18