about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-04-26 10:23:12 +0200
committerMarvin Löbel <loebel.marvin@gmail.com>2013-04-26 10:23:12 +0200
commit928a07e9cb576640d122fbd7428b8a39b925c5f7 (patch)
treea45024ecec2527c04dd3583ad98d9062683c444d
parente1be9ae22468e19d66daaebbceeeeaea2e75f903 (diff)
downloadrust-928a07e9cb576640d122fbd7428b8a39b925c5f7.tar.gz
rust-928a07e9cb576640d122fbd7428b8a39b925c5f7.zip
Added test cases for all fail message formats
-rw-r--r--src/test/run-fail/assert-macro-explicit.rs15
-rw-r--r--src/test/run-fail/assert-macro-fmt.rs15
-rw-r--r--src/test/run-fail/assert-macro-owned.rs15
-rw-r--r--src/test/run-fail/assert-macro-static.rs15
-rw-r--r--src/test/run-fail/fail-macro-explicit.rs15
-rw-r--r--src/test/run-fail/fail-macro-fmt.rs15
-rw-r--r--src/test/run-fail/fail-macro-owned.rs15
-rw-r--r--src/test/run-fail/fail-macro-static.rs15
8 files changed, 120 insertions, 0 deletions
diff --git a/src/test/run-fail/assert-macro-explicit.rs b/src/test/run-fail/assert-macro-explicit.rs
new file mode 100644
index 00000000000..8c35c92ffb0
--- /dev/null
+++ b/src/test/run-fail/assert-macro-explicit.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'assertion failed: false'
+
+fn main() {
+    assert!(false);
+}
diff --git a/src/test/run-fail/assert-macro-fmt.rs b/src/test/run-fail/assert-macro-fmt.rs
new file mode 100644
index 00000000000..d2397605378
--- /dev/null
+++ b/src/test/run-fail/assert-macro-fmt.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'test-assert-fmt 42 rust'
+
+fn main() {
+    assert!(false, "test-assert-fmt %d %s", 42, "rust");
+}
diff --git a/src/test/run-fail/assert-macro-owned.rs b/src/test/run-fail/assert-macro-owned.rs
new file mode 100644
index 00000000000..baa47dbbd35
--- /dev/null
+++ b/src/test/run-fail/assert-macro-owned.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'test-assert-owned'
+
+fn main() {
+    assert!(false, ~"test-assert-owned");
+}
diff --git a/src/test/run-fail/assert-macro-static.rs b/src/test/run-fail/assert-macro-static.rs
new file mode 100644
index 00000000000..d47455173d1
--- /dev/null
+++ b/src/test/run-fail/assert-macro-static.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'test-assert-static'
+
+fn main() {
+    assert!(false, "test-assert-static");
+}
diff --git a/src/test/run-fail/fail-macro-explicit.rs b/src/test/run-fail/fail-macro-explicit.rs
new file mode 100644
index 00000000000..eac80db40b9
--- /dev/null
+++ b/src/test/run-fail/fail-macro-explicit.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'explicit failure'
+
+fn main() {
+    fail!();
+}
diff --git a/src/test/run-fail/fail-macro-fmt.rs b/src/test/run-fail/fail-macro-fmt.rs
new file mode 100644
index 00000000000..363c572f3fe
--- /dev/null
+++ b/src/test/run-fail/fail-macro-fmt.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'test-fail-fmt 42 rust'
+
+fn main() {
+    fail!("test-fail-fmt %d %s", 42, "rust");
+}
diff --git a/src/test/run-fail/fail-macro-owned.rs b/src/test/run-fail/fail-macro-owned.rs
new file mode 100644
index 00000000000..6bed79a885f
--- /dev/null
+++ b/src/test/run-fail/fail-macro-owned.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'test-fail-owned'
+
+fn main() {
+    fail!(~"test-fail-owned");
+}
diff --git a/src/test/run-fail/fail-macro-static.rs b/src/test/run-fail/fail-macro-static.rs
new file mode 100644
index 00000000000..3235dc761a2
--- /dev/null
+++ b/src/test/run-fail/fail-macro-static.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern:task failed at 'test-fail-static'
+
+fn main() {
+    fail!("test-fail-static");
+}