]> git.lizzy.rs Git - rust.git/commitdiff
Add tests for #2511
authorSeiichi Uchida <seuchida@gmail.com>
Tue, 6 Mar 2018 10:42:38 +0000 (19:42 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Tue, 6 Mar 2018 10:42:38 +0000 (19:42 +0900)
tests/source/if_while_or_patterns.rs [new file with mode: 0644]
tests/target/if_while_or_patterns.rs [new file with mode: 0644]

diff --git a/tests/source/if_while_or_patterns.rs b/tests/source/if_while_or_patterns.rs
new file mode 100644 (file)
index 0000000..f01df7e
--- /dev/null
@@ -0,0 +1,27 @@
+#![feature(if_while_or_patterns)]
+
+fn main() {
+    if let 0 | 1 = 0 {
+        println!("hello, world");
+    };
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbbbbbb | cccccccccccccccc | d_100 = 0 {
+        println!("hello, world");
+    }
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbb | ccccccccccccccccccccc | d_101 = 0 {
+        println!("hello, world");
+    }
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbb | ccccccccccccccccccccc | d_103 = 0 {
+        println!("hello, world");
+    }
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbb | ccccccccccccccccccccc | d_105 = 0 {
+        println!("hello, world");
+    }
+
+    while let xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx = foo_bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccccccccccccc) {
+        println!("hello, world");
+    }
+}
diff --git a/tests/target/if_while_or_patterns.rs b/tests/target/if_while_or_patterns.rs
new file mode 100644 (file)
index 0000000..61a357a
--- /dev/null
@@ -0,0 +1,38 @@
+#![feature(if_while_or_patterns)]
+
+fn main() {
+    if let 0 | 1 = 0 {
+        println!("hello, world");
+    };
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbbbbbb | cccccccccccccccc | d_100 = 0 {
+        println!("hello, world");
+    }
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbb | ccccccccccccccccccccc | d_101 = 0
+    {
+        println!("hello, world");
+    }
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbbbbbbbbbbbbbbb | ccccccccccccccccccccc | d_103 =
+        0
+    {
+        println!("hello, world");
+    }
+
+    if let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+    | bbbbbbbbbbbbbbbbbbbbbbb
+    | ccccccccccccccccccccc
+    | d_105 = 0
+    {
+        println!("hello, world");
+    }
+
+    while let xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx
+    | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx | xxx = foo_bar(
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+        cccccccccccccccccccccccccccccccccccccccc,
+    ) {
+        println!("hello, world");
+    }
+}