about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYacin Tmimi <yacintmimi@gmail.com>2022-07-09 17:54:59 -0400
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>2022-07-09 19:59:09 -0500
commit2403f827bf1e427a04ce45c88a64cbebe91041d7 (patch)
tree7a55d14948e2f8391d6372f651438a8998d054e4
parent35f4c55bf476884feadf525e110453f6815f8dd8 (diff)
downloadrust-2403f827bf1e427a04ce45c88a64cbebe91041d7.tar.gz
rust-2403f827bf1e427a04ce45c88a64cbebe91041d7.zip
Add test case for issue 1306 which was resolved
Closes 1306

It's unclear when the issue was fixed, but it cannot be reproduced.
-rw-r--r--tests/source/issue_1306.rs29
-rw-r--r--tests/target/issue_1306.rs33
2 files changed, 62 insertions, 0 deletions
diff --git a/tests/source/issue_1306.rs b/tests/source/issue_1306.rs
new file mode 100644
index 00000000000..03b78e34108
--- /dev/null
+++ b/tests/source/issue_1306.rs
@@ -0,0 +1,29 @@
+// rustfmt-max_width: 160
+// rustfmt-fn_call_width: 96
+// rustfmt-fn_args_layout: Compressed
+// rustfmt-trailing_comma: Always
+// rustfmt-wrap_comments: true
+
+fn foo() {
+    for elem in try!(gen_epub_book::ops::parse_descriptor_file(&mut try!(File::open(&opts.source_file.1).map_err(|_| {
+        gen_epub_book::Error::Io {
+            desc: "input file",
+            op: "open",
+            more: None,
+        }
+    })),
+                                                               "input file")) {
+        println!("{}", elem);
+    }
+}
+
+fn write_content() {
+    io::copy(try!(File::open(in_f).map_err(|_| {
+        Error::Io {
+            desc: "Content",
+            op: "open",
+            more: None,
+        }
+    })),
+             w);
+}
diff --git a/tests/target/issue_1306.rs b/tests/target/issue_1306.rs
new file mode 100644
index 00000000000..6bb514cdfe5
--- /dev/null
+++ b/tests/target/issue_1306.rs
@@ -0,0 +1,33 @@
+// rustfmt-max_width: 160
+// rustfmt-fn_call_width: 96
+// rustfmt-fn_args_layout: Compressed
+// rustfmt-trailing_comma: Always
+// rustfmt-wrap_comments: true
+
+fn foo() {
+    for elem in try!(gen_epub_book::ops::parse_descriptor_file(
+        &mut try!(File::open(&opts.source_file.1).map_err(|_| {
+            gen_epub_book::Error::Io {
+                desc: "input file",
+                op: "open",
+                more: None,
+            }
+        })),
+        "input file"
+    )) {
+        println!("{}", elem);
+    }
+}
+
+fn write_content() {
+    io::copy(
+        try!(File::open(in_f).map_err(|_| {
+            Error::Io {
+                desc: "Content",
+                op: "open",
+                more: None,
+            }
+        })),
+        w,
+    );
+}