Debian Codegraph @

test-suite/ltac2/array_notation.v

raw
1 Require Import Ltac2.Ltac2.
2
3 Ltac2 Type exn ::= [ Regression_Test_Failure ].
4
5 Ltac2 check_eq_int_array(a1: int array)(a2: int array) :=
6 if Array.equal Int.equal a1 a2 then () else Control.throw Regression_Test_Failure.
7
8 Goal True.
9 check_eq_int_array [| 1; 22; 333 |] (Array.of_list [1; 22; 333]).
10 check_eq_int_array [| 22 |] (Array.of_list [22]).
11 check_eq_int_array [| |] (Array.of_list []). (* space between [| and |] is mandatory *)
12 constructor.
13 Qed.
14
15 (* Test that tactic dispatch where "[|" is two tokens still works: *)
16
17 Goal True /\ True.
18 Proof.
19 split > [|constructor]. constructor.
20 Qed.
21
22 Goal forall a b: nat, a = b -> True /\ a = b /\ True.
23 Proof.
24 intros.
25 (split > [|split]) > [|exact H|].
26 all: constructor.
27 Qed.
28
29 Set Default Proof Mode "Classic".
30
31 Goal True /\ True.
32 Proof.
33 split; [|constructor]. constructor.
34 Qed.
35
36 Goal forall a b: nat, a = b -> True /\ a = b /\ True.
37 Proof.
38 intros.
39 (split; [|split]); [|exact H|].
40 all: constructor.
41 Qed.