Skip to content

Commit

Permalink
add test for issue #995
Browse files Browse the repository at this point in the history
  • Loading branch information
kanigsson committed Jun 30, 2022
1 parent 48b4f54 commit 9563ee9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/specification_model_generator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,3 +892,29 @@ def test_session_boolean_relations(global_rel: str, local_rel: str, tmp_path: Pa
end Test;
"""
utils.assert_compilable_code_string(spec, tmp_path)


@pytest.mark.verification
def test_message_field_conditions_provability(tmp_path: Path) -> None:
spec = """
package Test is
type Byte is range 0 .. 2 ** 8 - 1 with Size => 8;
type Length_16 is range 0 .. 2 ** 16 - 1 with Size => 16;
type My_Seq is sequence of Byte;
type Repr is
message
Count : Byte;
Length : Length_16;
Hash : My_Seq
with Size => 32
then Structs
with Size => 8 * Length - 16 - (Hash'Last - Count'First + 1)
if 8 * Length >= 16 + (Hash'Last - Count'First + 1);
Structs : My_Seq;
end message
with Byte_Order => Low_Order_First;
end Test;
"""
utils.assert_provable_code_string(spec, tmp_path)

0 comments on commit 9563ee9

Please sign in to comment.