about summary refs log tree commit diff stats
path: root/js/scripting-lang/tests/07_case_expressions.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/tests/07_case_expressions.txt')
-rw-r--r--js/scripting-lang/tests/07_case_expressions.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/scripting-lang/tests/07_case_expressions.txt b/js/scripting-lang/tests/07_case_expressions.txt
index 83bd1bb..ccc447c 100644
--- a/js/scripting-lang/tests/07_case_expressions.txt
+++ b/js/scripting-lang/tests/07_case_expressions.txt
@@ -5,13 +5,13 @@
 factorial : n -> 
   when n is
     0 then 1
-    _ then n * (factorial (n - 1));
+    _ then n * (@factorial (n - 1));
 
 grade : score -> 
   when score is
-    90 then "A"
-    80 then "B"
-    70 then "C"
+    score >= 90 then "A"
+    score >= 80 then "B"
+    score >= 70 then "C"
     _  then "F";
 
 /* Test case expressions */
@@ -22,9 +22,9 @@ grade3 : grade 65;
 
 /* Test results */
 ..assert fact5 = 120;
-..assert grade1 = "F";  /* 95 doesn't match 90, so falls through to wildcard */
-..assert grade2 = "F";  /* 85 doesn't match 80, so falls through to wildcard */
-..assert grade3 = "F";
+..assert grade1 = "A";  /* 95 >= 90, so matches first case */
+..assert grade2 = "B";  /* 85 >= 80, so matches second case */
+..assert grade3 = "F";  /* 65 < 70, so falls through to wildcard */
 
 /* Multi-parameter case expressions */
 compare : x y ->