test(tests/lean): tests for error handling improvements
This commit is contained in:
parent
9438366e37
commit
362a0ec04c
2 changed files with 46 additions and 0 deletions
38
tests/lean/errors.lean
Normal file
38
tests/lean/errors.lean
Normal file
|
@ -0,0 +1,38 @@
|
|||
namespace foo
|
||||
|
||||
definition tst1 : nat → nat → nat :=
|
||||
a + b -- ERROR
|
||||
|
||||
check tst1
|
||||
|
||||
definition tst2 : nat → nat → nat :=
|
||||
begin
|
||||
intro a,
|
||||
intro b,
|
||||
cases add wth (a, b), -- ERROR
|
||||
exact a,
|
||||
exact b,
|
||||
end
|
||||
|
||||
section
|
||||
parameter A : Type
|
||||
definition tst3 : A → A → A :=
|
||||
begin
|
||||
intro a,
|
||||
apply b, -- ERROR
|
||||
exact a
|
||||
end
|
||||
|
||||
check tst3
|
||||
end
|
||||
|
||||
end foo
|
||||
|
||||
open nat
|
||||
|
||||
definition bla : nat :=
|
||||
foo.tst1 0 0 + foo.tst2 0 0 + foo.tst3 nat 1 1
|
||||
|
||||
check foo.tst1
|
||||
check foo.tst2
|
||||
check foo.tst3
|
8
tests/lean/errors.lean.expected.out
Normal file
8
tests/lean/errors.lean.expected.out
Normal file
|
@ -0,0 +1,8 @@
|
|||
errors.lean:4:0: error: unknown identifier 'a'
|
||||
tst1 : nat → nat → nat
|
||||
errors.lean:12:12: error: invalid tactic expression
|
||||
errors.lean:22:12: error: unknown identifier 'b'
|
||||
tst3 A : A → A → A
|
||||
foo.tst1 : ℕ → ℕ → ℕ
|
||||
foo.tst2 : ℕ → ℕ → ℕ
|
||||
foo.tst3 : Π (A : Type), A → A → A
|
Loading…
Reference in a new issue