Skip to content

Commit

Permalink
Adding new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevendeo committed Oct 3, 2023
1 parent 37db150 commit 553b9f8
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 21 deletions.
6 changes: 4 additions & 2 deletions src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ let main () =
| ".ae" -> Options.set_output_format Native
| ".smt2" | ".psmt2" -> Options.set_output_format Smtlib2
| s ->
warning "The output format %s is not supported by the Dolmen frontend." s
warning
"The output format %s is not supported by the Dolmen frontend."
s
in
(* The function In_channel.input_all is not available before OCaml 4.14. *)
let read_all ch =
Expand Down Expand Up @@ -587,7 +589,7 @@ let main () =
(* TODO: add the location of the statement. *)
error ~default:st "No model produced."
else
(* TODO: add the location of the statement. *)
(* TODO: add the location of the statement. *)
error ~default:st "Model generation disabled (try --produce-models)"

| {contents = `Get_info kind; _ } ->
Expand Down
68 changes: 55 additions & 13 deletions tests/dune.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
(=> (and (<= 0 p) (< p q) (<= q 10)) (<= (select a p) (select a q))))))
(check-sat)
(get-model)
; (get-model) should fail because the problem is UNSAT.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(error "Invalid (get-info :reason-unknown)")

unknown
unsupported
Expand All @@ -10,4 +9,3 @@ unsupported
(:name "Alt-Ergo")
(:reason-unknown Incomplete)
(:version dev)
unsupported
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
(set-logic ALL)

(declare-const x Int)
(declare-const y Int)

(assert (= (* x x) 4))

(get-info :reason-unknown)
(check-sat)
(get-info :all-statistics)
(get-info :assertion-stack-levels)
(get-info :authors)
(get-info :error-behavior)
(get-info :name)
(get-info :reason-unknown)
(get-info :version)
(get-info :foo)
(get-info :version)
1 change: 1 addition & 0 deletions tests/smtlib/testfile-get-info2.err.dolmen.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(error "Invalid (get-info :reason-unknown)")
8 changes: 8 additions & 0 deletions tests/smtlib/testfile-get-info2.err.dolmen.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(set-logic ALL)

(declare-const x Int)

(assert (= (* x x) 4))

(get-info :reason-unknown)
(check-sat)
1 change: 1 addition & 0 deletions tests/smtlib/testfile-get-info3.dolmen.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unsupported
1 change: 1 addition & 0 deletions tests/smtlib/testfile-get-info3.dolmen.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(get-info :foo)

0 comments on commit 553b9f8

Please sign in to comment.