about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-08-23 18:25:50 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2011-08-25 18:24:45 -0700
commitd9bc3cb10c4d1e856998c8e35ce7d89e0d74f4d6 (patch)
tree1c61d6788336a0e076328f76cc33d792dad92f37 /src/test
parent1cb85015c397cefa9de7653a98b7572ef511e0ef (diff)
downloadrust-d9bc3cb10c4d1e856998c8e35ce7d89e0d74f4d6.tar.gz
rust-d9bc3cb10c4d1e856998c8e35ce7d89e0d74f4d6.zip
Change "pred" to "pure fn" in all libraries and test cases
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/constrained-type-missing-check.rs2
-rw-r--r--src/test/compile-fail/do-while-pred-constraints.rs2
-rw-r--r--src/test/compile-fail/if-check-precond-fail.rs2
-rw-r--r--src/test/compile-fail/impure-pred.rs2
-rw-r--r--src/test/compile-fail/not-pred-args.rs2
-rw-r--r--src/test/compile-fail/pred-assign.rs2
-rw-r--r--src/test/compile-fail/pred-on-wrong-slots.rs2
-rw-r--r--src/test/compile-fail/pred-swap.rs2
-rw-r--r--src/test/compile-fail/while-loop-pred-constraints.rs2
-rw-r--r--src/test/run-fail/if-check-fail.rs2
-rw-r--r--src/test/run-fail/pred.rs2
-rw-r--r--src/test/run-pass/claim-nonterm.rs2
-rw-r--r--src/test/run-pass/constrained-type.rs2
-rw-r--r--src/test/run-pass/if-check-precond.rs2
-rw-r--r--src/test/run-pass/if-check.rs2
-rw-r--r--src/test/run-pass/pred-check.rs2
-rw-r--r--src/test/run-pass/pred-not-bool.rs2
-rw-r--r--src/test/run-pass/pred.rs2
-rw-r--r--src/test/run-pass/typestate-transitive.rs2
-rw-r--r--src/test/run-pass/wierd-exprs.rs2
-rw-r--r--src/test/stdtest/vec.rs2
21 files changed, 22 insertions, 20 deletions
diff --git a/src/test/compile-fail/constrained-type-missing-check.rs b/src/test/compile-fail/constrained-type-missing-check.rs
index 4ad2380a788..78c8f64ee9c 100644
--- a/src/test/compile-fail/constrained-type-missing-check.rs
+++ b/src/test/compile-fail/constrained-type-missing-check.rs
@@ -8,7 +8,7 @@ tag list { cons(int, @list); nil; }
 
 type bubu = {x: int, y: int};
 
-pred less_than(x: int, y: int) -> bool { ret x < y; }
+pure fn less_than(x: int, y: int) -> bool { ret x < y; }
 
 type ordered_range = {low: int, high: int} : less_than(low, high);
 
diff --git a/src/test/compile-fail/do-while-pred-constraints.rs b/src/test/compile-fail/do-while-pred-constraints.rs
index 90fcd26ea9f..49e7ec220bb 100644
--- a/src/test/compile-fail/do-while-pred-constraints.rs
+++ b/src/test/compile-fail/do-while-pred-constraints.rs
@@ -2,7 +2,7 @@
 
 fn print_even(y: int) : even(y) { log y; }
 
-pred even(y: int) -> bool { true }
+pure fn even(y: int) -> bool { true }
 
 fn main() {
     let y: int = 42;
diff --git a/src/test/compile-fail/if-check-precond-fail.rs b/src/test/compile-fail/if-check-precond-fail.rs
index 9ce0d6f8ef5..aed84faacc3 100644
--- a/src/test/compile-fail/if-check-precond-fail.rs
+++ b/src/test/compile-fail/if-check-precond-fail.rs
@@ -1,5 +1,5 @@
 // error-pattern:Unsatisfied precondition constraint
-pred even(x: uint) -> bool {
+pure fn even(x: uint) -> bool {
     if x < 2u {
         ret false;
     } else if x == 2u { ret true; } else { ret even(x - 2u); }
diff --git a/src/test/compile-fail/impure-pred.rs b/src/test/compile-fail/impure-pred.rs
index 05433ba17ed..42715eaa36e 100644
--- a/src/test/compile-fail/impure-pred.rs
+++ b/src/test/compile-fail/impure-pred.rs
@@ -3,7 +3,7 @@
 
 fn g() { }
 
-pred f(q: int) -> bool { g(); ret true; }
+pure fn f(q: int) -> bool { g(); ret true; }
 
 fn main() {
     let x = 0;
diff --git a/src/test/compile-fail/not-pred-args.rs b/src/test/compile-fail/not-pred-args.rs
index 6ba399ba00c..7a90f1cfa99 100644
--- a/src/test/compile-fail/not-pred-args.rs
+++ b/src/test/compile-fail/not-pred-args.rs
@@ -2,7 +2,7 @@
 
 // error-pattern: Constraint args must be
 
-pred f(q: int) -> bool { ret true; }
+pure fn f(q: int) -> bool { ret true; }
 
 fn main() {
     // should fail to typecheck, as pred args must be slot variables
diff --git a/src/test/compile-fail/pred-assign.rs b/src/test/compile-fail/pred-assign.rs
index 10c6f1443ec..f8975bb1889 100644
--- a/src/test/compile-fail/pred-assign.rs
+++ b/src/test/compile-fail/pred-assign.rs
@@ -4,7 +4,7 @@
 
 fn f(a: int, b: int) : lt(a, b) { }
 
-pred lt(a: int, b: int) -> bool { ret a < b; }
+pure fn lt(a: int, b: int) -> bool { ret a < b; }
 
 fn main() {
     let a: int = 10;
diff --git a/src/test/compile-fail/pred-on-wrong-slots.rs b/src/test/compile-fail/pred-on-wrong-slots.rs
index 9e6c86c0737..3d887e8d6ef 100644
--- a/src/test/compile-fail/pred-on-wrong-slots.rs
+++ b/src/test/compile-fail/pred-on-wrong-slots.rs
@@ -4,7 +4,7 @@
 
 fn f(a: int, b: int) : lt(a, b) { }
 
-pred lt(a: int, b: int) -> bool { ret a < b; }
+pure fn lt(a: int, b: int) -> bool { ret a < b; }
 
 fn main() {
     let a: int = 10;
diff --git a/src/test/compile-fail/pred-swap.rs b/src/test/compile-fail/pred-swap.rs
index 8fe7b19acf5..26cca68c5e4 100644
--- a/src/test/compile-fail/pred-swap.rs
+++ b/src/test/compile-fail/pred-swap.rs
@@ -4,7 +4,7 @@
 
 fn f(a: int, b: int) : lt(a, b) { }
 
-pred lt(a: int, b: int) -> bool { ret a < b; }
+pure fn lt(a: int, b: int) -> bool { ret a < b; }
 
 fn main() {
     let a: int = 10;
diff --git a/src/test/compile-fail/while-loop-pred-constraints.rs b/src/test/compile-fail/while-loop-pred-constraints.rs
index 5920d25230f..bf761b31199 100644
--- a/src/test/compile-fail/while-loop-pred-constraints.rs
+++ b/src/test/compile-fail/while-loop-pred-constraints.rs
@@ -2,7 +2,7 @@
 
 fn print_even(y: int) : even(y) { log y; }
 
-pred even(y: int) -> bool { true }
+pure fn even(y: int) -> bool { true }
 
 fn main() {
 
diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs
index 885c92deab8..2af0b111f8e 100644
--- a/src/test/run-fail/if-check-fail.rs
+++ b/src/test/run-fail/if-check-fail.rs
@@ -1,5 +1,5 @@
 // error-pattern:Number is odd
-pred even(x: uint) -> bool {
+pure fn even(x: uint) -> bool {
     if x < 2u {
         ret false;
     } else if x == 2u { ret true; } else { ret even(x - 2u); }
diff --git a/src/test/run-fail/pred.rs b/src/test/run-fail/pred.rs
index a2f9420825c..494bee968f1 100644
--- a/src/test/run-fail/pred.rs
+++ b/src/test/run-fail/pred.rs
@@ -2,6 +2,6 @@
 // error-pattern:Predicate lt(b, a) failed
 fn f(a: int, b: int) { }
 
-pred lt(a: int, b: int) -> bool { ret a < b; }
+pure fn lt(a: int, b: int) -> bool { ret a < b; }
 
 fn main() { let a: int = 10; let b: int = 23; check (lt(b, a)); f(b, a); }
diff --git a/src/test/run-pass/claim-nonterm.rs b/src/test/run-pass/claim-nonterm.rs
index 770beeb9fbf..13741ef3961 100644
--- a/src/test/run-pass/claim-nonterm.rs
+++ b/src/test/run-pass/claim-nonterm.rs
@@ -3,6 +3,6 @@ use std;
 import std::str::*;
 import std::uint::*;
 
-pred fails(a: uint) -> bool { fail; }
+pure fn fails(a: uint) -> bool { fail; }
 
 fn main() { let b: uint = 4u; claim (fails(b)); }
diff --git a/src/test/run-pass/constrained-type.rs b/src/test/run-pass/constrained-type.rs
index d05e4311dbf..fdf48e2fb04 100644
--- a/src/test/run-pass/constrained-type.rs
+++ b/src/test/run-pass/constrained-type.rs
@@ -4,7 +4,7 @@ tag list { cons(int, @list); nil; }
 
 type bubu = {x: int, y: int};
 
-pred less_than(x: int, y: int) -> bool { ret x < y; }
+pure fn less_than(x: int, y: int) -> bool { ret x < y; }
 
 type ordered_range = {low: int, high: int}  : less_than(*.low, *.high);
 
diff --git a/src/test/run-pass/if-check-precond.rs b/src/test/run-pass/if-check-precond.rs
index eadffd7b75a..5f3715273ae 100644
--- a/src/test/run-pass/if-check-precond.rs
+++ b/src/test/run-pass/if-check-precond.rs
@@ -1,4 +1,4 @@
-pred even(x: uint) -> bool {
+pure fn even(x: uint) -> bool {
     if x < 2u {
         ret false;
     } else if x == 2u { ret true; } else { ret even(x - 2u); }
diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs
index 090330bef0e..508bc8385cf 100644
--- a/src/test/run-pass/if-check.rs
+++ b/src/test/run-pass/if-check.rs
@@ -1,4 +1,4 @@
-pred even(x: uint) -> bool {
+pure fn even(x: uint) -> bool {
     if x < 2u {
         ret false;
     } else if x == 2u { ret true; } else { ret even(x - 2u); }
diff --git a/src/test/run-pass/pred-check.rs b/src/test/run-pass/pred-check.rs
index 12b1ff5ed73..588288cea2f 100644
--- a/src/test/run-pass/pred-check.rs
+++ b/src/test/run-pass/pred-check.rs
@@ -1,4 +1,4 @@
 // -*- rust -*-
-pred f(q: int) -> bool { ret true; }
+pure fn f(q: int) -> bool { ret true; }
 
 fn main() { let x = 0; check (f(x)); }
diff --git a/src/test/run-pass/pred-not-bool.rs b/src/test/run-pass/pred-not-bool.rs
index 1f70cb73f60..6d1ad3a72ad 100644
--- a/src/test/run-pass/pred-not-bool.rs
+++ b/src/test/run-pass/pred-not-bool.rs
@@ -1,3 +1,5 @@
+// FIXME should be in run-pass
+
 // -*- rust -*-
 
 // error-pattern: Non-boolean return type
diff --git a/src/test/run-pass/pred.rs b/src/test/run-pass/pred.rs
index 5c9a56c904c..212e77cbdc1 100644
--- a/src/test/run-pass/pred.rs
+++ b/src/test/run-pass/pred.rs
@@ -1,7 +1,7 @@
 // -*- rust -*-
 fn f(a: int, b: int) { }
 
-pred lt(a: int, b: int) -> bool { ret a < b; }
+pure fn lt(a: int, b: int) -> bool { ret a < b; }
 
 fn main() {
     let a: int = 10;
diff --git a/src/test/run-pass/typestate-transitive.rs b/src/test/run-pass/typestate-transitive.rs
index 021dd7554b7..632aec5c4d1 100644
--- a/src/test/run-pass/typestate-transitive.rs
+++ b/src/test/run-pass/typestate-transitive.rs
@@ -1,4 +1,4 @@
-pred p(i: int) -> bool { true }
+pure fn p(i: int) -> bool { true }
 
 fn f(i: int) : p(i) -> int { i }
 
diff --git a/src/test/run-pass/wierd-exprs.rs b/src/test/run-pass/wierd-exprs.rs
index de1613c4363..68add65630f 100644
--- a/src/test/run-pass/wierd-exprs.rs
+++ b/src/test/run-pass/wierd-exprs.rs
@@ -40,7 +40,7 @@ fn hammertime() -> int {
 }
 
 fn canttouchthis() -> uint {
-    pred p() -> bool { true }
+    pure fn p() -> bool { true }
     let _a = (assert (true)) == (check (p()));
     let _c = (check (p())) == ();
     let _b = (log 0) == (ret 0u);
diff --git a/src/test/stdtest/vec.rs b/src/test/stdtest/vec.rs
index a57056c552d..f5c4af42681 100644
--- a/src/test/stdtest/vec.rs
+++ b/src/test/stdtest/vec.rs
@@ -10,7 +10,7 @@ fn square(n: uint) -> uint { ret n * n; }
 
 fn square_alias(n: &uint) -> uint { ret n * n; }
 
-pred is_three(n: &uint) -> bool { ret n == 3u; }
+pure fn is_three(n: &uint) -> bool { ret n == 3u; }
 
 fn square_if_odd(n: &uint) -> option::t<uint> {
     ret if n % 2u == 1u { some(n * n) } else { none };