Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Match error messages completely
Browse files Browse the repository at this point in the history
Alexander Senier committed Mar 9, 2021
1 parent b4b4ac3 commit 77703d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/unit/specification/parser_test.py
Original file line number Diff line number Diff line change
@@ -2424,7 +2424,6 @@ def test_parse_error_invalid_enum(spec: str, error: str) -> None:


def test_complex_dependencies() -> None:

p4_protocol_number = model.ModularInteger(
"P4::Protocol_Number", expr.Pow(expr.Number(2), expr.Number(16))
)
@@ -2490,8 +2489,8 @@ def test_parse_error_duplicate_spec_file_file() -> None:
p.parse(SPEC_DIR / "message_type.rflx")
with pytest.raises(
RecordFluxError,
match='parser: error: duplicate specification "tests/data/specs/subdir/message_type.rflx"\n'
'parser: error: previous specification "tests/data/specs/message_type.rflx"',
match='^parser: error: duplicate specification "tests/data/specs/subdir/message_type.rflx"\n'
'parser: error: previous specification "tests/data/specs/message_type.rflx"$',
):
p.parse(SPEC_DIR / "subdir/message_type.rflx")

@@ -2511,7 +2510,7 @@ def test_parse_error_duplicate_spec_stdin_file() -> None:
)
with pytest.raises(
RecordFluxError,
match='parser: error: duplicate specification "tests/data/specs/subdir/message_type.rflx"\n'
'parser: error: previous specification "<stdin>"',
match='^parser: error: duplicate specification "tests/data/specs/subdir/message_type.rflx"\n'
'parser: error: previous specification "<stdin>"$',
):
p.parse(SPEC_DIR / "subdir/message_type.rflx")

0 comments on commit 77703d7

Please sign in to comment.