aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/bugs/closed/bug_4502.v17
-rw-r--r--test-suite/bugs/closed/bug_9114.v5
-rw-r--r--test-suite/ltac2/term_notations.v33
-rw-r--r--test-suite/output-coqtop/ShowProofDiffs.out42
-rw-r--r--test-suite/output-coqtop/ShowProofDiffs.v6
-rw-r--r--test-suite/output/Tactics.out1
-rw-r--r--test-suite/output/Tactics.v8
-rw-r--r--test-suite/success/Fixpoint.v15
8 files changed, 127 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/bug_4502.v b/test-suite/bugs/closed/bug_4502.v
new file mode 100644
index 0000000000..f1dcae9773
--- /dev/null
+++ b/test-suite/bugs/closed/bug_4502.v
@@ -0,0 +1,17 @@
+Require Import FunInd.
+
+Set Universe Polymorphism.
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Strongly Strict Implicit.
+
+Function first_false (n : nat) (f : nat -> bool) : option nat :=
+ match n with
+ | O => None
+ | S m =>
+ match first_false m f with
+ | (Some _) as s => s
+ | None => if f m then None else Some m
+ end
+ end.
+(* undefined universe *)
diff --git a/test-suite/bugs/closed/bug_9114.v b/test-suite/bugs/closed/bug_9114.v
new file mode 100644
index 0000000000..2cf91c1c2b
--- /dev/null
+++ b/test-suite/bugs/closed/bug_9114.v
@@ -0,0 +1,5 @@
+Goal True.
+ assert_succeeds (exact I).
+ idtac.
+ (* Error: No such goal. *)
+Abort.
diff --git a/test-suite/ltac2/term_notations.v b/test-suite/ltac2/term_notations.v
new file mode 100644
index 0000000000..85eb858d4e
--- /dev/null
+++ b/test-suite/ltac2/term_notations.v
@@ -0,0 +1,33 @@
+Require Import Ltac2.Ltac2.
+
+(* Preterms are not terms *)
+Fail Notation "[ x ]" := $x.
+
+Section Foo.
+
+Notation "[ x ]" := ltac2:(Control.refine (fun _ => Constr.pretype x)).
+
+Goal [ True ].
+Proof.
+constructor.
+Qed.
+
+End Foo.
+
+Section Bar.
+
+(* Have fun with context capture *)
+Notation "[ x ]" := ltac2:(
+ let c () := Constr.pretype x in
+ refine constr:(forall n : nat, n = ltac2:(Notations.exact0 true c))
+).
+
+Goal forall n : nat, [ n ].
+Proof.
+reflexivity.
+Qed.
+
+(* This fails currently, which is arguably a bug *)
+Fail Goal [ n ].
+
+End Bar.
diff --git a/test-suite/output-coqtop/ShowProofDiffs.out b/test-suite/output-coqtop/ShowProofDiffs.out
new file mode 100644
index 0000000000..285a3bcd89
--- /dev/null
+++ b/test-suite/output-coqtop/ShowProofDiffs.out
@@ -0,0 +1,42 @@
+
+Coq < Coq < 1 subgoal
+
+ ============================
+ forall i : nat, exists j k : nat, i = j /\ j = k /\ i = k
+
+x <
+x < 1 focused subgoal
+(shelved: 1)
+ i : nat
+ ============================
+ exists k : nat, i = ?j /\ ?j = k /\ i = k
+
+(fun i : nat =>
+ ex_intro (fun j : nat => exists k : nat, i = j /\ j = k /\ i = k) ?j ?Goal)
+
+x < 1 focused subgoal
+(shelved: 2)
+ i : nat
+ ============================
+ i = ?j /\ ?j = ?k /\ i = ?k
+
+(fun i : nat =>
+ ex_intro (fun j : nat => exists k : nat, i = j /\ j = k /\ i = k) 
+ ?j (ex_intro (fun k : nat => i = ?j /\ ?j = k /\ i = k) ?k ?Goal))
+
+x < 2 focused subgoals
+(shelved: 2)
+ i : nat
+ ============================
+ i = ?j
+
+subgoal 2 is:
+ ?j = ?k /\ i = ?k
+
+(fun i : nat =>
+ ex_intro (fun j : nat => exists k : nat, i = j /\ j = k /\ i = k) 
+ ?j
+ (ex_intro (fun k : nat => i = ?j /\ ?j = k /\ i = k) 
+ ?k (conj ?Goal ?Goal0)))
+
+x <
diff --git a/test-suite/output-coqtop/ShowProofDiffs.v b/test-suite/output-coqtop/ShowProofDiffs.v
new file mode 100644
index 0000000000..4251c52cb4
--- /dev/null
+++ b/test-suite/output-coqtop/ShowProofDiffs.v
@@ -0,0 +1,6 @@
+(* coq-prog-args: ("-color" "on" "-diffs" "on") *)
+Lemma x: forall(i : nat), exists(j k : nat), i = j /\ j = k /\ i = k.
+Proof using.
+ eexists. Show Proof Diffs.
+ eexists. Show Proof Diffs.
+ split. Show Proof Diffs.
diff --git a/test-suite/output/Tactics.out b/test-suite/output/Tactics.out
index 19c9fc4423..70427220ed 100644
--- a/test-suite/output/Tactics.out
+++ b/test-suite/output/Tactics.out
@@ -6,3 +6,4 @@ The command has indeed failed with message:
H is already used.
The command has indeed failed with message:
H is already used.
+a
diff --git a/test-suite/output/Tactics.v b/test-suite/output/Tactics.v
index fa12f09a46..96b6d652c9 100644
--- a/test-suite/output/Tactics.v
+++ b/test-suite/output/Tactics.v
@@ -22,3 +22,11 @@ intros H.
Fail intros [H%myid ?].
Fail destruct 1 as [H%myid ?].
Abort.
+
+
+(* Test that assert_succeeds only runs a tactic once *)
+Ltac should_not_loop := idtac + should_not_loop.
+Goal True.
+ assert_succeeds should_not_loop.
+ assert_succeeds (idtac "a" + idtac "b"). (* should only output "a" *)
+Abort.
diff --git a/test-suite/success/Fixpoint.v b/test-suite/success/Fixpoint.v
index 81c9763ccd..6c333121da 100644
--- a/test-suite/success/Fixpoint.v
+++ b/test-suite/success/Fixpoint.v
@@ -96,10 +96,25 @@ Section visibility.
Let Fixpoint by_proof (n:nat) : True.
Proof. exact I. Defined.
+
+ Let Fixpoint foo (n:nat) : bool with bar (n:nat) : bool.
+ Proof.
+ - destruct n as [|n].
+ + exact true.
+ + exact (bar n).
+ - destruct n as [|n].
+ + exact false.
+ + exact (foo n).
+ Qed.
+
+ Let Fixpoint bla (n:nat) : Type with bli (n:nat) : bool.
+ Admitted.
+
End visibility.
Fail Check imm.
Fail Check by_proof.
+Check bla. Check bli.
Module Import mod_local.
Fixpoint imm_importable (n:nat) : True := I.