Skip to content

Commit

Permalink
Add interactive test files
Browse files Browse the repository at this point in the history
Ref. #243
  • Loading branch information
Alexander Senier authored and treiher committed Jul 23, 2020
1 parent 2c28188 commit 5401223
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/ide/multiple_errors.rflx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
-- error: dependency cycle
with Multiple_Errors;

-- error: RFLX prefix not allowed
-- error: Package identifier inconsistent with file name
package RFLX_Invalid is

type R is range 5 .. 23 with Size => 16;
type R_Array is array of R;

-- error: Type exceeds limit
type S is mod 2**128;

-- error: Duplicate type
type R is (R_E1, R_E2) with Size => 8;

-- error: Redefinition of built-in type
type Boolean is (Foo, Bar) with Size => 12;

-- error: Conflicting literals
type R2 is (R2_E1, R2_E2, Foo) with Size => 24;

type M1 is
message
null
then X
with Length => 2 * 8;
-- error: Aggregate element out of range (2 times)
X : Opaque
then Y
with Length => 5 * 8
if X = (1, 256, 20, 500);
-- error: Aggregate element out of range (3 times)
Y : R_Array
then null if Y = (1, 10, 20, 50, 60);
end message;

type M2 is
message
-- error: Undefined component type
Z : Undef_Type
-- error: Undefined component
then X;
end message;

-- error: End identifier inconsistent with package identifier
end Inconsistent;
13 changes: 13 additions & 0 deletions tests/ide/parse_error_aggregate_non_number.rflx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package Parse_Error_Aggregate_Non_Number is

type M is
message
null
then X
with Length => 2 * 8;
X : Opaque
-- error: Element is no number
then null if X = (1, 100, foo);
end message;

end Parse_Error_Aggregate_Non_Number;
10 changes: 10 additions & 0 deletions tests/ide/parse_error_invalid_location.rflx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package Parse_Error_Invalid_Location is

type M is
message
Y : Boolean
then null
with Invalid => 5;
end message;

end Parse_Error_Invalid_Location;

0 comments on commit 5401223

Please sign in to comment.