-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cram tests on the effect of optional arguments
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
In this file, we test the effect of the optional arguments of the command-line. | ||
|
||
$ export ORTAC_ONLY_PLUGIN=qcheck-stm | ||
$ cat > foo.mli << EOF | ||
> type 'a t | ||
> (*@ mutable model value : 'a *) | ||
> val make : 'a -> 'a t | ||
> (*@ t = make a | ||
> ensures t.value = a *) | ||
> EOF | ||
$ ortac qcheck-stm foo.mli "make 42" "int t" --include=mod | head | ||
(* This file is generated by ortac qcheck-stm, | ||
edit how you run the tool instead *) | ||
open Foo | ||
module Spec = | ||
struct | ||
open STM | ||
[@@@ocaml.warning "-26-27"] | ||
include Mod | ||
type sut = int t | ||
type cmd = | | ||
$ ortac qcheck-stm foo.mli "make 42" "int t" --protect-call=protect | tail | ||
match (cmd__004_, res__006_) with | _ -> true | ||
let run cmd__010_ sut__011_ = match cmd__010_ with | ||
end | ||
module STMTests = (STM_sequential.Make)(Spec) | ||
let _ = | ||
Spec.protect | ||
(fun () -> | ||
QCheck_base_runner.run_tests_main | ||
(let count = 1000 in | ||
[STMTests.agree_test ~count ~name:"Foo STM tests"])) |