test(tests/lean): add tests for structure command error messages

This commit is contained in:
Leonardo de Moura 2015-01-30 09:49:34 -08:00
parent 7c59c959db
commit ea9a9d63d1
2 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,31 @@
structure foo :=
(x : bool)
structure boo :=
(x : nat)
structure bla extends foo, boo
structure boo2 :=
{x : bool}
structure bla extends foo, boo2
structure bla extends foo :=
(x : num)
structure bla extends foo :=
( : num)
structure bla extends foo :=
mk :: y z : num
structure bla2 extends foo renaming y → z
structure bla2 extends nat
structure bla2 extends Type
structure bla2 : Prop :=
(x : Prop)

View file

@ -0,0 +1,11 @@
bad_structures2.lean:7:27: error: invalid 'structure' header, field 'x' from 'boo' has already been declared with a different type
bool
and
nat
bad_structures2.lean:12:27: error: invalid 'structure' header, field 'x' has already been declared with a different binder annotation
bad_structures2.lean:15:1: error: field 'x' has been declared in parent structure
bad_structures2.lean:18:2: error: invalid field, identifier expected
bad_structures2.lean:23:36: error: invalid 'structure' renaming, parent structure 'foo' does not contain field 'y'
bad_structures2.lean:25:23: error: invalid 'structure' extends, 'nat' is not a structure
bad_structures2.lean:27:23: error: invalid 'structure', expression must be a 'parent' structure
bad_structures2.lean:30:15: error: invalid 'structure', 'Type' expected