Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
try to fix bitwise tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjdbcm committed Nov 7, 2021
1 parent 398224b commit 73b365a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Aspidites/tests/test_aspidites.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import sys
import warnings
from pathlib import Path
Expand Down Expand Up @@ -200,12 +201,14 @@ def test_parse_comp_expr(p, q, binop, unop, compop):
assert eval(stmt) == eval(''.join(list_item.parseString(stmt)))


bit_op = re.compile(r"<<|>>|&|\||\^")


@hypothesis.settings(deadline=None)
@hypothesis.given(st.integers(min_value=1, max_value=255), # exponent
st.integers(min_value=1),
st.from_regex(r"<<|>>|&|\||\^", fullmatch=True),
st.text(['+', '-'], min_size=1, max_size=1))
def test_parse_bitwise(p, q, bitwise, unop):
st.from_regex(bit_op, fullmatch=True))
def test_parse_bitwise(p, q, bitwise):
stmt = str(p) + bitwise + str(q)
assert eval(stmt) == eval(''.join(list_item.parseString(stmt)))

Expand Down

0 comments on commit 73b365a

Please sign in to comment.