diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2017-10-24 13:08:15 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2017-10-24 13:08:15 +0200 |
commit | e1e736840ed8c925e2ff442861963250a72d4385 (patch) | |
tree | c4d32c321c14df61d5d04f7356c1a6f97efbb1e9 /tests | |
parent | 3cd6317dc21cfb5bda950ae3ba29daf48e71f006 (diff) |
Update sheet traversal
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/sheet_test.ml | 13 |
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; |