File tree 4 files changed +19
-9
lines changed
4 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 1
- Axiom test_axiom : False.
1
+ Axiom test_axiom : False.
2
+ Axiom another_axiom : False.
Original file line number Diff line number Diff line change 1
1
Require Import Preloaded.
2
2
3
3
Lemma solution : 1 + 1 = 3.
4
- Proof . firstorder using test_axiom. Qed .
4
+ Proof . firstorder using test_axiom. Qed .
5
+
6
+ Lemma solution2 : 1 + 1 = 3 /\ 2 + 2 = 4.
7
+ Proof . split; [firstorder using test_axiom | firstorder using another_axiom]. Qed .
Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ CWGroup "Tests for Solution.solution".
12
12
(* CWEndTest is optional before CWTest or CWEndGroup *)
13
13
CWEndTest.
14
14
CWTest "Assumptions test".
15
- CWAssert "Testing solution" Solution.solution Assumes. (*test_axiom. *)
15
+ CWAssert "Testing solution" Solution.solution Assumes test_axiom.
16
+ CWAssert "Testing solution (failure)" Solution.solution Assumes. (*test_axiom. *)
17
+ CWAssert "Testing solution2" Solution.solution2 Assumes test_axiom another_axiom.
18
+ CWAssert "Testing solution2 (failure 1)" Solution.solution2 Assumes test_axiom.
19
+ CWAssert "Testing solution2 (failure 2)" Solution.solution2 Assumes.
16
20
CWTest "Type test 2".
17
21
Definition expected := 1 + 1 = 3.
18
22
CWAssert Solution.solution : expected.
Original file line number Diff line number Diff line change @@ -109,18 +109,20 @@ let test_axioms ?(msg = "Axiom Test") c_ref ax_refs =
109
109
let ax_objs = List. map (fun c -> Printer. Axiom (Printer. Constant c, [] )) ax_csts in
110
110
let ax_set = Printer.ContextObjectSet. of_list ax_objs in
111
111
let assums = assumptions c_ref in
112
- let iter t ty =
112
+ let iter t ty axioms =
113
113
match t with
114
114
| Printer. Axiom (ax , _ ) ->
115
- if Printer.ContextObjectSet. mem t ax_set then ()
115
+ if Printer.ContextObjectSet. mem t ax_set then axioms
116
116
else begin
117
117
let p_axiom = pr_axiom env sigma ax ty in
118
- failed ( Printf. sprintf " %s \n Prohibited Axiom: %s " msg (string_of_ppcmds p_axiom))
118
+ string_of_ppcmds p_axiom :: axioms
119
119
end
120
- | _ -> ()
120
+ | _ -> axioms
121
121
in
122
- let () = Printer.ContextObjectMap. iter iter assums in
123
- passed msg
122
+ let axioms = Printer.ContextObjectMap. fold_left iter assums [] in
123
+ match axioms with
124
+ | [] -> passed msg
125
+ | _ -> failed (Printf. sprintf " %s\n Prohibited Axioms: %s" msg (String. concat " \n " axioms))
124
126
125
127
(* * Tests that the file size is less than a given number *)
126
128
let test_file_size ?(fname = solution_file) size =
You can’t perform that action at this time.
0 commit comments