home
/
code
/
tiger.ml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b53d50d
)
Expect syntax error in test49.tig
author
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 16 Sep 2018 16:17:35 +0000
(12:17 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 16 Sep 2018 16:17:35 +0000
(12:17 -0400)
compiler/src/lib/tiger/tiger_test.ml
patch
|
blob
|
blame
|
history
compiler/src/lib/tiger/tiger_test.mli
patch
|
blob
|
blame
|
history
compiler/src/lib/tiger/tiger_test_cases_book.ml
patch
|
blob
|
blame
|
history
diff --git
a/compiler/src/lib/tiger/tiger_test.ml
b/compiler/src/lib/tiger/tiger_test.ml
index
47939df
..
1a27cf2
100644
(file)
--- a/
compiler/src/lib/tiger/tiger_test.ml
+++ b/
compiler/src/lib/tiger/tiger_test.ml
@@
-46,6
+46,7
@@
type t =
; code : string
; out_lexing : (Tiger_parser.token list) option
; out_parsing : Tiger_absyn.t option
; code : string
; out_lexing : (Tiger_parser.token list) option
; out_parsing : Tiger_absyn.t option
+ ; is_error_expected_parsing : (Tiger_error.t -> bool) option
; is_error_expected_semant : (Tiger_error.t -> bool) option
}
; is_error_expected_semant : (Tiger_error.t -> bool) option
}
@@
-120,6
+121,7
@@
let status_skip ?(info="") () =
let case
?(out_lexing=None)
?(out_parsing=None)
let case
?(out_lexing=None)
?(out_parsing=None)
+ ?(is_error_expected_parsing=None)
?(is_error_expected_semant=None)
~code
name
?(is_error_expected_semant=None)
~code
name
@@
-128,6
+130,7
@@
let case
; code
; out_lexing
; out_parsing
; code
; out_lexing
; out_parsing
+ ; is_error_expected_parsing
; is_error_expected_semant
}
; is_error_expected_semant
}
@@
-291,6
+294,7
@@
let run tests =
; code
; out_lexing
; out_parsing
; code
; out_lexing
; out_parsing
+ ; is_error_expected_parsing
; is_error_expected_semant
}
->
; is_error_expected_semant
}
->
@@
-305,7
+309,7
@@
let run tests =
run_pass
~f:(fun () -> pass_parsing ~fake_filename:name ~code)
~expect_output:out_parsing
run_pass
~f:(fun () -> pass_parsing ~fake_filename:name ~code)
~expect_output:out_parsing
- ~is_error_expected:
None
+ ~is_error_expected:
is_error_expected_parsing
in
let res_sem =
run_pass
in
let res_sem =
run_pass
diff --git
a/compiler/src/lib/tiger/tiger_test.mli
b/compiler/src/lib/tiger/tiger_test.mli
index
30527a5
..
58d743c
100644
(file)
--- a/
compiler/src/lib/tiger/tiger_test.mli
+++ b/
compiler/src/lib/tiger/tiger_test.mli
@@
-3,6
+3,7
@@
type t
val case
: ?out_lexing : Tiger_parser.token list option
-> ?out_parsing : Tiger_absyn.t option
val case
: ?out_lexing : Tiger_parser.token list option
-> ?out_parsing : Tiger_absyn.t option
+ -> ?is_error_expected_parsing : (Tiger_error.t -> bool) option
-> ?is_error_expected_semant : (Tiger_error.t -> bool) option
-> code : string
-> string
-> ?is_error_expected_semant : (Tiger_error.t -> bool) option
-> code : string
-> string
diff --git
a/compiler/src/lib/tiger/tiger_test_cases_book.ml
b/compiler/src/lib/tiger/tiger_test_cases_book.ml
index
1ef024d
..
25e004d
100644
(file)
--- a/
compiler/src/lib/tiger/tiger_test_cases_book.ml
+++ b/
compiler/src/lib/tiger/tiger_test_cases_book.ml
@@
-80,6
+80,16
@@
let out_parsing_of_filename _ =
(* TODO: Fill-in expected cases *)
None
(* TODO: Fill-in expected cases *)
None
+let is_error_expected_parsing_of_filename =
+ let module E = Tiger_error in
+ function
+ | "test49.tig" ->
+ Some (function E.Invalid_syntax _ -> true | _ -> false)
+ (* TODO: Be more specific - test position *)
+ | _ ->
+ (* TODO: Fill-in other expected cases *)
+ None
+
let is_error_expected_semant_of_filename _ =
(* TODO: Fill-in expected cases *)
None
let is_error_expected_semant_of_filename _ =
(* TODO: Fill-in expected cases *)
None
@@
-90,6
+100,7
@@
let test_case_of_filename filename ~dir =
~code:(read_file (Filename.concat dir filename))
~out_lexing:(out_lexing_of_filename filename)
~out_parsing:(out_parsing_of_filename filename)
~code:(read_file (Filename.concat dir filename))
~out_lexing:(out_lexing_of_filename filename)
~out_parsing:(out_parsing_of_filename filename)
+ ~is_error_expected_parsing:(is_error_expected_parsing_of_filename filename)
~is_error_expected_semant:(is_error_expected_semant_of_filename filename)
let read ~from_dir:dir =
~is_error_expected_semant:(is_error_expected_semant_of_filename filename)
let read ~from_dir:dir =
This page took
0.033747 seconds
and
4
git commands to generate.