diff options
| author | Tim Chevalier <[email protected]> | 2011-05-02 11:23:07 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-02 12:16:29 -0700 |
| commit | aa25f22f197682de3b18fc4c8ba068d1feda220f (patch) | |
| tree | 6d01f8fbb5680964fd9c53564c96aa58cb75d3d1 /src/test/run-fail | |
| parent | rustc: Add a "fat tydesc" LLVM type to trans (diff) | |
| download | rust-aa25f22f197682de3b18fc4c8ba068d1feda220f.tar.xz rust-aa25f22f197682de3b18fc4c8ba068d1feda220f.zip | |
Use different syntax for checks that matter to typestate
This giant commit changes the syntax of Rust to use "assert" for
"check" expressions that didn't mean anything to the typestate
system, and continue using "check" for checks that are used as
part of typestate checking.
Most of the changes are just replacing "check" with "assert" in test
cases and rustc.
Diffstat (limited to 'src/test/run-fail')
| -rw-r--r-- | src/test/run-fail/fail.rs | 2 | ||||
| -rw-r--r-- | src/test/run-fail/linked-failure.rs | 2 | ||||
| -rw-r--r-- | src/test/run-fail/str-overrun.rs | 4 | ||||
| -rw-r--r-- | src/test/run-fail/vec-overrun.rs | 4 | ||||
| -rw-r--r-- | src/test/run-fail/vec-underrun.rs | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/test/run-fail/fail.rs b/src/test/run-fail/fail.rs index e8c9cf71..c688a404 100644 --- a/src/test/run-fail/fail.rs +++ b/src/test/run-fail/fail.rs @@ -2,5 +2,5 @@ // error-pattern:1 == 2 fn main() { - check (1 == 2); + assert (1 == 2); } diff --git a/src/test/run-fail/linked-failure.rs b/src/test/run-fail/linked-failure.rs index 7def7c11..60e82200 100644 --- a/src/test/run-fail/linked-failure.rs +++ b/src/test/run-fail/linked-failure.rs @@ -4,7 +4,7 @@ // error-pattern:1 == 2 fn child() { - check (1 == 2); + assert (1 == 2); } fn main() { diff --git a/src/test/run-fail/str-overrun.rs b/src/test/run-fail/str-overrun.rs index 4388cb3a..68b1e263 100644 --- a/src/test/run-fail/str-overrun.rs +++ b/src/test/run-fail/str-overrun.rs @@ -6,12 +6,12 @@ fn main() { let str s = "hello"; let int x = 0; - check (s.(x) == (0x68 as u8)); + assert (s.(x) == (0x68 as u8)); // NB: at the moment a string always has a trailing NULL, // so the largest index value on the string above is 5, not // 4. Possibly change this. // Bounds-check failure. - check (s.(x + 6) == (0x0 as u8)); + assert (s.(x + 6) == (0x0 as u8)); } diff --git a/src/test/run-fail/vec-overrun.rs b/src/test/run-fail/vec-overrun.rs index 961da730..810feb39 100644 --- a/src/test/run-fail/vec-overrun.rs +++ b/src/test/run-fail/vec-overrun.rs @@ -6,7 +6,7 @@ fn main() { let vec[int] v = vec(10); let int x = 0; - check (v.(x) == 10); + assert (v.(x) == 10); // Bounds-check failure. - check (v.(x + 2) == 20); + assert (v.(x + 2) == 20); } diff --git a/src/test/run-fail/vec-underrun.rs b/src/test/run-fail/vec-underrun.rs index a230d1be..f1998da5 100644 --- a/src/test/run-fail/vec-underrun.rs +++ b/src/test/run-fail/vec-underrun.rs @@ -6,7 +6,7 @@ fn main() { let vec[int] v = vec(10, 20); let int x = 0; - check (v.(x) == 10); + assert (v.(x) == 10); // Bounds-check failure. - check (v.(x-1) == 20); + assert (v.(x-1) == 20); } |