diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/sheet_test.ml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/sheet_test.ml b/tests/sheet_test.ml index db09f37..7c5da64 100755 --- a/tests/sheet_test.ml +++ b/tests/sheet_test.ml @@ -75,7 +75,7 @@ let test_create_direct_cycle ctx = begin ignore @@ Sheet.add ~history:false (Expression.load @@ u"=B2 + 1") (2,2) s; let _, result, _ = Sheet.get_cell (2, 2) s in - let expected = Some (ScTypes.Result.Error Errors.TypeError) in + let expected = Some (ScTypes.Result.Error Errors.Cycle) in assert_equal ~msg:(_msg ~expected ~result) @@ -165,7 +165,7 @@ let test_update_succs1 ctx = begin let result = Sheet.add ~history:false (Expression.load @@ u"=2") (1,1) s in (* All the cells are updated by the change *) - let expected = Cell.Set.of_list [(1,1); (1, 2); (2,2)] in + let expected = Cell.Set.of_list [(1, 2); (1, 1); (2, 2)] in let msg = Printf.sprintf "Expected %s but got %s" (UTF8.raw_encode @@ Tools.String.print_buffer Cell.Set.printb expected) @@ -186,9 +186,13 @@ let test_update_succs2 ctx = begin let result = Sheet.add ~history:false (Expression.load @@ u"=2") (1,1) s in (* Only (1, 1) is updated ; (2, 2) does not change, neither (2, 2) *) - let expected = Cell.Set.of_list [(1,1)] in + let expected = Cell.Set.of_list [(1,2); (1,1)] in - assert_equal + let msg = Printf.sprintf "Expected %s but got %s" + (UTF8.raw_encode @@ Tools.String.print_buffer Cell.Set.printb expected) + (UTF8.raw_encode @@ Tools.String.print_buffer Cell.Set.printb result) in + + assert_equal ~msg expected result end @@ -232,10 +236,10 @@ let tests = "sheet_test">::: [ "test_ref2" >:: test_create_ref_2; "test_cycle1" >:: test_create_direct_cycle; "test_recover_cycle" >:: test_recover_from_cycle; - (*"test_cycle2" >:: test_create_indirect_cycle;*) + "test_cycle2" >:: test_create_indirect_cycle; "test_cycle3" >:: test_check_cycle3; "test_delete" >:: test_delete; "test_update_succs1" >:: test_update_succs1; - (*"test_update_succs2" >:: test_update_succs2;*) + "test_update_succs2" >:: test_update_succs2; "test_paste_undo" >:: test_paste_undo; ] |