summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/issue-1210
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/issue-1210')
-rw-r--r--src/tools/rustfmt/tests/target/issue-1210/a.rs16
-rw-r--r--src/tools/rustfmt/tests/target/issue-1210/b.rs16
-rw-r--r--src/tools/rustfmt/tests/target/issue-1210/c.rs7
-rw-r--r--src/tools/rustfmt/tests/target/issue-1210/d.rs4
-rw-r--r--src/tools/rustfmt/tests/target/issue-1210/e.rs11
5 files changed, 54 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/issue-1210/a.rs b/src/tools/rustfmt/tests/target/issue-1210/a.rs
new file mode 100644
index 000000000..94c1b44e5
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-1210/a.rs
@@ -0,0 +1,16 @@
+// 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/target/issue-1210/b.rs b/src/tools/rustfmt/tests/target/issue-1210/b.rs
new file mode 100644
index 000000000..a7b1e3bcd
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-1210/b.rs
@@ -0,0 +1,16 @@
+// 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/target/issue-1210/c.rs b/src/tools/rustfmt/tests/target/issue-1210/c.rs
new file mode 100644
index 000000000..183d79f92
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-1210/c.rs
@@ -0,0 +1,7 @@
+// 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/target/issue-1210/d.rs b/src/tools/rustfmt/tests/target/issue-1210/d.rs
new file mode 100644
index 000000000..9279e6fc9
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/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/target/issue-1210/e.rs b/src/tools/rustfmt/tests/target/issue-1210/e.rs
new file mode 100644
index 000000000..55f80c6c3
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/issue-1210/e.rs
@@ -0,0 +1,11 @@
+// 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.";