diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/rustfmt/tests/source/issue-1210/a.rs | 12 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/source/issue-1210/b.rs | 12 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/source/issue-1210/c.rs | 5 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/source/issue-1210/d.rs | 4 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/source/issue-1210/e.rs | 8 |
5 files changed, 41 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-1210/a.rs b/src/tools/rustfmt/tests/source/issue-1210/a.rs new file mode 100644 index 000000000..6bb9964b4 --- /dev/null +++ b/src/tools/rustfmt/tests/source/issue-1210/a.rs @@ -0,0 +1,12 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +impl Foo { + fn cxx(&self, target: &str) -> &Path { + match self.cxx.get(target) { + Some(p) => p.path(), + None => panic!("\n\ntarget `{}` is not configured as a host, + only as a target\n\n", target), + } + } +} diff --git a/src/tools/rustfmt/tests/source/issue-1210/b.rs b/src/tools/rustfmt/tests/source/issue-1210/b.rs new file mode 100644 index 000000000..8c71ef98b --- /dev/null +++ b/src/tools/rustfmt/tests/source/issue-1210/b.rs @@ -0,0 +1,12 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +impl Foo { + fn cxx(&self, target: &str) -> &Path { + match self.cxx.get(target) { + Some(p) => p.path(), + None => panic!("\ntarget `{}`: is not, configured as a host, + only as a target\n\n", target), + } + } +} diff --git a/src/tools/rustfmt/tests/source/issue-1210/c.rs b/src/tools/rustfmt/tests/source/issue-1210/c.rs new file mode 100644 index 000000000..c080cef95 --- /dev/null +++ b/src/tools/rustfmt/tests/source/issue-1210/c.rs @@ -0,0 +1,5 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +const foo: String = "trailing_spaces!! + keep them! Amet neque. Praesent rhoncus eros non velit."; diff --git a/src/tools/rustfmt/tests/source/issue-1210/d.rs b/src/tools/rustfmt/tests/source/issue-1210/d.rs new file mode 100644 index 000000000..783736bc3 --- /dev/null +++ b/src/tools/rustfmt/tests/source/issue-1210/d.rs @@ -0,0 +1,4 @@ +// rustfmt-wrap_comments: true + +// trailing_spaces_in_comment!! +// remove those from above diff --git a/src/tools/rustfmt/tests/source/issue-1210/e.rs b/src/tools/rustfmt/tests/source/issue-1210/e.rs new file mode 100644 index 000000000..9abada1d6 --- /dev/null +++ b/src/tools/rustfmt/tests/source/issue-1210/e.rs @@ -0,0 +1,8 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +// explicit line breaks should be kept in order to preserve the layout + +const foo: String = "Suspendisse vel augue at felis tincidunt sollicitudin. Fusce arcu. + Duis et odio et leo + sollicitudin consequat. Aliquam lobortis. Phasellus condimentum."; |