File tree Expand file tree Collapse file tree 4 files changed +19
-9
lines changed Expand file tree Collapse file tree 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 11Require Import Preloaded.
22
33Lemma 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".
1212 (* CWEndTest is optional before CWTest or CWEndGroup *)
1313 CWEndTest.
1414 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.
1620 CWTest "Type test 2".
1721 Definition expected := 1 + 1 = 3.
1822 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 =
109109 let ax_objs = List. map (fun c -> Printer. Axiom (Printer. Constant c, [] )) ax_csts in
110110 let ax_set = Printer.ContextObjectSet. of_list ax_objs in
111111 let assums = assumptions c_ref in
112- let iter t ty =
112+ let iter t ty axioms =
113113 match t with
114114 | Printer. Axiom (ax , _ ) ->
115- if Printer.ContextObjectSet. mem t ax_set then ()
115+ if Printer.ContextObjectSet. mem t ax_set then axioms
116116 else begin
117117 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
119119 end
120- | _ -> ()
120+ | _ -> axioms
121121 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))
124126
125127(* * Tests that the file size is less than a given number *)
126128let test_file_size ?(fname = solution_file) size =
You can’t perform that action at this time.
0 commit comments