aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/sheet_test.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/sheet_test.ml b/tests/sheet_test.ml
index b289b14..c1af5d5 100755
--- a/tests/sheet_test.ml
+++ b/tests/sheet_test.ml
@@ -53,7 +53,7 @@ end
let test_create_direct_cycle ctx = begin
let s = Sheet.Raw.create
- |> Sheet.Raw.add (2,2) @@ Expression.load @@ u"=B2"
+ |> Sheet.Raw.add (2,2) @@ Expression.load @@ u"=B2 + 1"
|> snd in
let result = (Sheet.Raw.get_value (2, 2) s) in
let expected = Some (ScTypes.Error Errors.TypeError) in
@@ -68,11 +68,12 @@ let test_create_indirect_cycle ctx = begin
let s = Sheet.Raw.create
|> Sheet.Raw.add (2,2) @@ Expression.load @@ u"=A1"
- |> snd |> Sheet.Raw.add (1,1) @@ Expression.load @@ u"=B2"
+ |> snd |> Sheet.Raw.add (1,1) @@ Expression.load @@ u"=2"
+ |> snd |> Sheet.Raw.add (1,1) @@ Expression.load @@ u"=B2+1"
|> snd |> Sheet.Raw.add (0,0) @@ Expression.load @@ u"=A1"
|> snd in
let result = (Sheet.Raw.get_value (0, 0) s) in
- let expected = Some (ScTypes.Error Errors.TypeError) in
+ let expected = Some (ScTypes.Error Errors.Cycle) in
assert_equal
~msg:(_msg ~expected ~result)
@@ -80,7 +81,7 @@ let test_create_indirect_cycle ctx = begin
result
end
-let test_check_BFS ctx = begin
+let test_check_cycle3 ctx = begin
let s = Sheet.Raw.create
(* First set A1 to 3 *)
@@ -158,11 +159,11 @@ let test_update_succs2 ctx = begin
end
let tests = "sheet_test">::: [
- "test_ref2" >:: test_create_ref_2;
"test_ref1" >:: test_create_ref_1;
+ "test_ref2" >:: test_create_ref_2;
"test_cycle1" >:: test_create_direct_cycle;
"test_cycle2" >:: test_create_indirect_cycle;
- "test_BFS" >:: test_check_BFS;
+ "test_cycle3" >:: test_check_cycle3;
"test_delete" >:: test_delete;
"test_update_succs1" >:: test_update_succs1;
"test_update_succs2" >:: test_update_succs2;