diff options
| author | Hugo Herbelin | 2015-09-08 12:02:43 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2015-09-08 13:49:55 +0200 |
| commit | f2130a88e1f67d68d1062cce883a7c2666b146d8 (patch) | |
| tree | efdb6140e6fdcc9ebd3fb30c5c823d6c41132a1a /test-suite | |
| parent | dea62dfc660ffd61958c50e955f7b962afd83234 (diff) | |
Ensuring that patterns of the form pat/constr move the hypotheses replacing
an initial hypothesis hyp at the same position in the context.
Ensuring the same for "apply c in hyp as pat".
Ensuring that "pose proof (H ...) as H" does not change the position of H.
Diffstat (limited to 'test-suite')
| -rw-r--r-- | test-suite/success/apply.v | 11 | ||||
| -rw-r--r-- | test-suite/success/intros.v | 18 | ||||
| -rw-r--r-- | test-suite/success/specialize.v | 20 |
3 files changed, 48 insertions, 1 deletions
diff --git a/test-suite/success/apply.v b/test-suite/success/apply.v index 074004fa12..55b666b723 100644 --- a/test-suite/success/apply.v +++ b/test-suite/success/apply.v @@ -548,3 +548,14 @@ apply (foo ?y). Grab Existential Variables. exact 0. Qed. + +(* Test position of new hypotheses when using "apply ... in ... as ..." *) +Goal (True -> 0=0 /\ True) -> True -> False -> True/\0=0. +intros H H0 H1. +apply H in H0 as (a,b). +(* clear H1:False *) match goal with H:_ |- _ => clear H end. +split. +- (* use b:True *) match goal with H:_ |- _ => exact H end. +- (* clear b:True *) match goal with H:_ |- _ => clear H end. + (* use a:0=0 *) match goal with H:_ |- _ => exact H end. +Qed. diff --git a/test-suite/success/intros.v b/test-suite/success/intros.v index 9443d01e3b..4959b65788 100644 --- a/test-suite/success/intros.v +++ b/test-suite/success/intros.v @@ -33,3 +33,21 @@ Goal True -> True -> True. intros _ ?. exact H. Qed. + +(* A short test about introduction pattern pat/c *) +Goal (True -> 0=0) -> True /\ False -> 0=0. +intros H (H1/H,_). +exact H1. +Qed. + +(* A test about bugs in 8.5beta2 *) +Goal (True -> 0=0) -> True /\ False -> False -> 0=0. +intros H H0 H1. +destruct H0 as (a/H,_). +(* Check that H0 is removed (was bugged in 8.5beta2) *) +Fail clear H0. +(* Check position of newly created hypotheses when using pat/c (was + left at top in 8.5beta2) *) +match goal with H:_ |- _ => clear H end. (* clear H1:False *) +match goal with H:_ |- _ => exact H end. (* check that next hyp shows 0=0 *) +Qed. diff --git a/test-suite/success/specialize.v b/test-suite/success/specialize.v index c5f032beb0..3faa1ca43a 100644 --- a/test-suite/success/specialize.v +++ b/test-suite/success/specialize.v @@ -45,4 +45,22 @@ specialize eq_trans with _ a b c. intros _. (* Anomaly: Evar ?88 was not declared. Please report. *) *) -Abort.
\ No newline at end of file +Abort. + +(* Test use of pose proof and assert as a specialize *) + +Goal True -> (True -> 0=0) -> False -> 0=0. +intros H0 H H1. +pose proof (H I) as H. +(* Check that the hypothesis is in 2nd position by removing the top one *) +match goal with H:_ |- _ => clear H end. +match goal with H:_ |- _ => exact H end. +Qed. + +Goal True -> (True -> 0=0) -> False -> 0=0. +intros H0 H H1. +assert (H:=H I). +(* Check that the hypothesis is in 2nd position by removing the top one *) +match goal with H:_ |- _ => clear H end. +match goal with H:_ |- _ => exact H end. +Qed. |
