Skip to content

Commit

Permalink
Detects duplicate messages and channels aspects
Browse files Browse the repository at this point in the history
This commit introduces extra checks to avoid duplicate aspects for messages and channels.
Closes #714
  • Loading branch information
mhadhbir committed Feb 9, 2022
1 parent 48bef96 commit 0b2025a
Showing 1 changed file with 0 additions and 70 deletions.
70 changes: 0 additions & 70 deletions tests/unit/specification/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1924,76 +1924,6 @@ def test_parse_error_invalid_context_clause(tmp_path: Path) -> None:
):
p.parse(test_file)

def test_parse_error_duplicate_message_aspect_size() -> None:
assert_error_string(
"""
package Test is
type M is
message
B : Opaque
with First => 123, Size => 123, Size => 521;
end message;
end Test;
""",
r'^<stdin>:6:61: parser: error: duplicate aspect "Size"',
)

def test_parse_error_duplicate_message_aspect_first() -> None:
assert_error_string(
"""
package Test is
type M is
message
B : Opaque
with First => 123, Size => 123, First => 521;
end message;
end Test;
""",
r'^<stdin>:6:61: parser: error: duplicate aspect "First"',
)

def test_parse_error_duplicate_channel_aspect_readable() -> None:
assert_error_string(
"""
package Test is
type M is
message
B : Opaque
with Size => 8;
end message;
generic
Channel : Channel with Readable, Writable, Readable;
session Session with
Initial => Start,
Final => Terminated
is
Message : M;
begin
state Start is
begin
Channel'Read (Message);
transition
goto Reply
if Message'Valid
goto Terminated
end Start;
state Reply is
begin
Channel'Write (Message);
transition
goto Terminated
end Reply;
state Terminated is null state;
end Session;
end Test;
""",
r'^<stdin>:11:60: parser: error: duplicate aspect "Readable"',
)

def test_parse_error_duplicate_message_aspect_size() -> None:
assert_error_string(
Expand Down

0 comments on commit 0b2025a

Please sign in to comment.