test(tests/lean): tests for error handling improvements

This commit is contained in:
Leonardo de Moura 2015-03-13 15:32:25 -07:00
parent 9438366e37
commit 362a0ec04c
2 changed files with 46 additions and 0 deletions

38
tests/lean/errors.lean Normal file
View 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

View 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