Skip to content

Commit

Permalink
chore: explode tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Caglayan <[email protected]>
  • Loading branch information
Alizter committed Sep 3, 2023
1 parent 280c178 commit c341455
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 121 deletions.
121 changes: 0 additions & 121 deletions test/Tests.v

This file was deleted.

16 changes: 16 additions & 0 deletions test/github1358.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
From HoTT Require Import Basics.

Axiom A@{i} : Type@{i}.

Axiom foo@{i} : A@{i} <~> A@{i}.

Definition bar@{i} : A@{i} <~> A@{i}.
Proof.
reflexivity.
Defined.

Definition bar'@{i} : A@{i} <~> A@{i}.
Proof.
exact equiv_idmap.
Defined.

32 changes: 32 additions & 0 deletions test/github1382.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From HoTT Require Import Basics Types.

(* Tests for discriminate tactic *)

Goal O = S O -> Empty.
discriminate 1.
Qed.

Goal forall H : O = S O, H = H.
discriminate H.
Qed.

Goal O = S O -> Unit.
intros H. discriminate H. Qed.
Goal O = S O -> Unit.
intros H. Ltac g x := discriminate x. g H. Qed.

Goal (forall x y : nat, x = y -> x = S y) -> Unit.
intros.
try discriminate (H O) || exact tt.
Qed.

Goal (forall x y : nat, x = y -> x = S y) -> Unit.
intros H. ediscriminate (H O). instantiate (1:=O). Abort.

(* Check discriminate on types with local definitions *)

Inductive A : Type0 := B (T := Unit) (x y : Bool) (z := x).
Goal forall x y, B x true = B y false -> Empty.
discriminate.
Qed.

9 changes: 9 additions & 0 deletions test/github370.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
From HoTT Require Import Basics Homotopy.Suspension.

Fail Check (fun (P : interval -> Type) (a : P Interval.zero) (b : P Interval.one)
(p p' : seg # a = b)
=> idpath : interval_ind P a b p = interval_rect P a b p').

Fail Check Type0 : Type0.
Check Susp nat : Type0.
Fail Check Susp Type0 : Type0.
7 changes: 7 additions & 0 deletions test/github390.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
From HoTT Require Import Basics Pointed Homotopy.Suspension.

(** Check that [ispointed_susp] doesn't require just a [Set] *)
Check (fun A : Type => _ : IsPointed (Susp A)).
Check (@ispointed_susp Type).
Check (@ispointed_susp Set).

4 changes: 4 additions & 0 deletions test/github726.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
From HoTT Require Import Basics Types.

(** Check that nested sigma-type notation didn't get clobbered by surreal cuts *)
Check ({ l : Unit & { n : Unit & Unit }}).
34 changes: 34 additions & 0 deletions test/github754.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From HoTT Require Import Basics Types DProp Tactics.EquivalenceInduction.

Local Open Scope nat_scope.

(** Test 1 from issue #754 *)
Inductive nat@{i | Set < i} : Type@{i} :=
| O : nat
| S : nat -> nat.
Fixpoint code_nat (m n : nat) {struct m} : DProp.DHProp :=
match m with
| O => match n with
| O => DProp.True
| S _ => DProp.False
end
| S m' => match n with
| O => DProp.False
| S n' => code_nat m' n'
end
end.

Local Set Warnings Append "-notation-overridden".
Notation "x =n y" := (code_nat x y) : nat_scope.
Local Set Warnings Append "notation-overridden".
Bind Scope nat_scope with nat.
Axiom equiv_path_nat :
forall n m : nat,
Trunc.trunctype_type (DProp.dhprop_hprop (n =n m)) <~> n = m.

Definition nat_discr `{Funext} {n: nat}: O <> S n.
Proof.
intro H'.
equiv_induction (@equiv_path_nat O (S n)).
assumption.
Qed.
11 changes: 11 additions & 0 deletions test/github973.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
From HoTT Require Import Basics.

Inductive vec (A : Type) : nat -> Type :=
| nil : vec A 0
| cons : forall n : nat, A -> vec A n -> vec A (S n).

Definition hd (A : Type) (n : nat) (v : vec A (S n)) : A :=
match v in (vec _ (S n)) return A with
| cons _ h _ => h
end.

0 comments on commit c341455

Please sign in to comment.