Project

General

Profile

Revision 0291fcfd src/tools/stateflow/json-parser/test_json_parser_variables.ml

View differences:

src/tools/stateflow/json-parser/test_json_parser_variables.ml
50 50
  let prog = Parse.parse_prog
51 51
      (Yojson.Basic.from_file "../data-test/simple-var-bool-false.json") in
52 52
  match prog with
53
  | Program ("simple-var-1", [ ], [ x ]) ->
53
  | Program ("simple_var_bool_false", [ ], [ x ]) ->
54 54
    test_var_skeleton x "x" Tydec_bool (Expr_const (Const_tag tag_false))
55 55
  | _ -> raise (OUnitTest.OUnit_failure
56 56
                  "Program obtained from simple-var-bool-false.json is not correct")
57 57

  
58
let test_simple_var_bool_true tests_ctxt =
59
  let prog = Parse.parse_prog
60
      (Yojson.Basic.from_file "../data-test/simple-var-bool-true.json") in
61
  match prog with
62
  | Program ("simple_var_bool_true", [ ], [ x ]) ->
63
    test_var_skeleton x "my_var" Tydec_bool (Expr_const (Const_tag tag_true))
64
  | _ -> raise (OUnitTest.OUnit_failure
65
                  "Program obtained from simple-var-bool-true.json is not correct")
66

  
58 67
let var_suite =
59 68
  "suite for variables" >:::
60
  [ "simple test for variable (boolean, false)" >:: test_simple_var_bool_false ]
69
  [ "simple test for variable (boolean, false)" >::
70
    test_simple_var_bool_false;
71
    "simple test for variable (boolean, true)"  >::
72
    test_simple_var_bool_true
73
  ]
61 74

  
62 75
let _ =
63 76
  run_test_tt_main var_suite

Also available in: Unified diff