aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-11-02 15:24:46 -0700
committerGraydon Hoare <[email protected]>2010-11-02 15:24:46 -0700
commit7db115834f24eb9d9ccbd2468c9145fdf86be514 (patch)
tree5e5e1463ba1201524c6d10690c0982f4b168ba9f /src/test
parentFirst pass on splitting stratum and opacity off of effects. WIP. (diff)
downloadrust-7db115834f24eb9d9ccbd2468c9145fdf86be514.tar.xz
rust-7db115834f24eb9d9ccbd2468c9145fdf86be514.zip
Split out stratum-checking pass, implement more-strict (overly aggressive) impure-effect checking.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/box-in-tup.rs2
-rw-r--r--src/test/run-pass/exterior.rs4
-rw-r--r--src/test/run-pass/foreach-nested-2.rs2
-rw-r--r--src/test/run-pass/foreach-nested.rs2
-rw-r--r--src/test/run-pass/lib-bitv.rs10
-rw-r--r--src/test/run-pass/vec-in-tup.rs2
-rw-r--r--src/test/run-pass/writealias.rs4
7 files changed, 13 insertions, 13 deletions
diff --git a/src/test/run-pass/box-in-tup.rs b/src/test/run-pass/box-in-tup.rs
index 53f3dc0f..b1ae7907 100644
--- a/src/test/run-pass/box-in-tup.rs
+++ b/src/test/run-pass/box-in-tup.rs
@@ -1,4 +1,4 @@
-fn main() {
+impure fn main() {
let tup(mutable @int) i = tup(mutable @10);
i._0 = @11;
} \ No newline at end of file
diff --git a/src/test/run-pass/exterior.rs b/src/test/run-pass/exterior.rs
index f09ee823..e131e38d 100644
--- a/src/test/run-pass/exterior.rs
+++ b/src/test/run-pass/exterior.rs
@@ -2,13 +2,13 @@
type point = rec(int x, int y, mutable int z);
-fn f(@point p) {
+impure fn f(@point p) {
check (p.z == 12);
p.z = 13;
check (p.z == 13);
}
-fn main() {
+impure fn main() {
let point a = rec(x=10, y=11, mutable z=12);
let @point b = @a;
check (b.z == 12);
diff --git a/src/test/run-pass/foreach-nested-2.rs b/src/test/run-pass/foreach-nested-2.rs
index d8d67c14..f06474b3 100644
--- a/src/test/run-pass/foreach-nested-2.rs
+++ b/src/test/run-pass/foreach-nested-2.rs
@@ -13,7 +13,7 @@ iter range(int start, int stop) -> int {
}
}
-fn main() {
+impure fn main() {
let vec[mutable int] a =
vec[mutable](-1, -1, -1, -1, -1, -1, -1, -1);
let int p = 0;
diff --git a/src/test/run-pass/foreach-nested.rs b/src/test/run-pass/foreach-nested.rs
index 6287477a..1da1d05b 100644
--- a/src/test/run-pass/foreach-nested.rs
+++ b/src/test/run-pass/foreach-nested.rs
@@ -5,7 +5,7 @@ iter two() -> int {
put 1;
}
-fn main() {
+impure fn main() {
let vec[mutable int] a = vec[mutable](-1, -1, -1, -1);
let int p = 0;
diff --git a/src/test/run-pass/lib-bitv.rs b/src/test/run-pass/lib-bitv.rs
index 162e8b13..c3ffa8ea 100644
--- a/src/test/run-pass/lib-bitv.rs
+++ b/src/test/run-pass/lib-bitv.rs
@@ -22,7 +22,7 @@ fn test_1_element() {
check (bitv.eq_vec(act, vec(1u)));
}
-fn test_10_elements() {
+impure fn test_10_elements() {
auto act;
// all 0
@@ -60,7 +60,7 @@ fn test_10_elements() {
check (bitv.eq_vec(act, vec(1u, 0u, 0u, 1u, 0u, 0u, 1u, 0u, 0u, 1u)));
}
-fn test_31_elements() {
+impure fn test_31_elements() {
auto act;
// all 0
@@ -132,7 +132,7 @@ fn test_31_elements() {
0u, 0u, 0u, 0u, 0u, 0u, 1u)));
}
-fn test_32_elements() {
+impure fn test_32_elements() {
auto act;
// all 0
@@ -206,7 +206,7 @@ fn test_32_elements() {
0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u)));
}
-fn test_33_elements() {
+impure fn test_33_elements() {
auto act;
// all 0
@@ -287,7 +287,7 @@ fn test_33_elements() {
1u)));
}
-fn main() {
+impure fn main() {
test_0_elements();
test_1_element();
test_10_elements();
diff --git a/src/test/run-pass/vec-in-tup.rs b/src/test/run-pass/vec-in-tup.rs
index 415554dd..97eb222e 100644
--- a/src/test/run-pass/vec-in-tup.rs
+++ b/src/test/run-pass/vec-in-tup.rs
@@ -1,4 +1,4 @@
-fn main() {
+impure fn main() {
let tup(mutable vec[int]) i = tup(mutable vec(1,2,3));
i._0 = vec(4,5,6);
}
diff --git a/src/test/run-pass/writealias.rs b/src/test/run-pass/writealias.rs
index 8bf8140f..551fb7d3 100644
--- a/src/test/run-pass/writealias.rs
+++ b/src/test/run-pass/writealias.rs
@@ -2,11 +2,11 @@
type point = rec(int x, int y, mutable int z);
-fn f(& mutable point p) {
+impure fn f(& mutable point p) {
p.z = 13;
}
-fn main() {
+impure fn main() {
let point x = rec(x=10, y=11, mutable z=12);
f(x);
check (x.z == 13);