about summary refs log tree commit diff
path: root/tests/source
diff options
context:
space:
mode:
authortopecongiro <seuchida@gmail.com>2017-05-04 13:52:35 +0900
committertopecongiro <seuchida@gmail.com>2017-05-04 14:32:13 +0900
commitb48f4e03b3889301284fbb6c8605cfe697d91e25 (patch)
tree5136043f6739219b9cdb34b929b52897a7566c79 /tests/source
parent8579c1db0e6fef523d5a86d9175fa5f1794fa5a7 (diff)
Add tests for issues which can be closed on master
Diffstat (limited to 'tests/source')
-rw-r--r--tests/source/closure.rs16
-rw-r--r--tests/source/comment.rs6
-rw-r--r--tests/source/issue-1350.rs16
-rw-r--r--tests/source/structs.rs8
-rw-r--r--tests/source/try-conversion.rs7
5 files changed, 53 insertions, 0 deletions
diff --git a/tests/source/closure.rs b/tests/source/closure.rs
index f6e8c093082..b8d998f2e59 100644
--- a/tests/source/closure.rs
+++ b/tests/source/closure.rs
@@ -104,3 +104,19 @@ fn issue1466() {
         ctx.create_device_local_buffer(buffer)
     });
 }
+
+fn issue470() {
+    {{{
+        let explicit_arg_decls =
+            explicit_arguments.into_iter()
+            .enumerate()
+            .map(|(index, (ty, pattern))| {
+                let lvalue = Lvalue::Arg(index as u32);
+                block = this.pattern(block,
+                                     argument_extent,
+                                     hair::PatternRef::Hair(pattern),
+                                     &lvalue);
+                ArgDecl { ty: ty }
+            });
+    }}}
+}
diff --git a/tests/source/comment.rs b/tests/source/comment.rs
index bce05ff7a2a..cf40e581b6e 100644
--- a/tests/source/comment.rs
+++ b/tests/source/comment.rs
@@ -33,6 +33,12 @@ fn test() {
 
     funk(); //dontchangeme
             // or me
+
+    // #1388
+    const EXCEPTION_PATHS: &'static [&'static str] =
+        &[// std crates
+          "src/libstd/sys/", // Platform-specific code for std lives here.
+          "src/bootstrap"];
 }
 
   /// test123
diff --git a/tests/source/issue-1350.rs b/tests/source/issue-1350.rs
new file mode 100644
index 00000000000..1baa1985a7e
--- /dev/null
+++ b/tests/source/issue-1350.rs
@@ -0,0 +1,16 @@
+// rustfmt-max_width: 120
+// rustfmt-comment_width: 110
+
+impl Struct {
+    fn fun() {
+        let result = match <R::RequestResult as serde::Deserialize>::deserialize(&json) {
+            Ok(v) => v,
+            Err(e) => {
+                match <R::ErrorResult as serde::Deserialize>::deserialize(&json) {
+                    Ok(v) => return Err(Error::with_json(v)),
+                    Err(e2) => return Err(Error::with_json(e)),
+                }
+            }
+        };
+    }
+}
diff --git a/tests/source/structs.rs b/tests/source/structs.rs
index 28bb95e1a2d..5dd9087682c 100644
--- a/tests/source/structs.rs
+++ b/tests/source/structs.rs
@@ -180,3 +180,11 @@ struct Deep {
 }
 
 struct Foo<C=()>(String);
+
+// #1364
+fn foo() {
+    convex_shape.set_point(0, &Vector2f { x: 400.0, y: 100.0 });
+    convex_shape.set_point(1, &Vector2f { x: 500.0, y: 70.0 });
+    convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
+    convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
+}
diff --git a/tests/source/try-conversion.rs b/tests/source/try-conversion.rs
index addf2f5d5e8..ed83ee9e101 100644
--- a/tests/source/try-conversion.rs
+++ b/tests/source/try-conversion.rs
@@ -9,3 +9,10 @@ fn main() {
 fn test() {
     a?
 }
+
+fn issue1291() {
+    try!(fs::create_dir_all(&gitfiledir).chain_err(|| {
+        format!("failed to create the {} submodule directory for the workarea",
+                name)
+    }));
+}