first commit
This commit is contained in:
commit
e1c6aeeeed
42 changed files with 1305 additions and 0 deletions
18
test/fuzz/fuzz.ml
Normal file
18
test/fuzz/fuzz.ml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
open Scfg
|
||||
|
||||
let () = Random.self_init ()
|
||||
|
||||
let () =
|
||||
Crowbar.add_test ~name:"Print and parse fuzzing" [ Gen.config ] (fun config ->
|
||||
let printed = Fmt.str "%a" Pp.config config in
|
||||
match Parse.from_string printed with
|
||||
| Error (`Msg msg) ->
|
||||
Crowbar.failf "%s on the given input@\n***`%S`@\n***`%s`@\n" msg printed
|
||||
printed
|
||||
| Ok config -> (
|
||||
let printed = Fmt.str "%a" Pp.config config in
|
||||
match Parse.from_string printed with
|
||||
| Error (`Msg msg) ->
|
||||
Crowbar.failf "%s on the given input@\n***`%S`@\n***`%s`@\n" msg printed
|
||||
printed
|
||||
| Ok parsed -> Crowbar.check_eq ~pp:Pp.config config parsed ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue