Skip to content

Commit

Permalink
Fix fromhex testing and add missing whitespace handling to known issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Jul 25, 2024
1 parent 234f50e commit 75c3707
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following deviations from Python semantics are known and code that involves

- `isinstance` does only check the constructor id of the Data object, not the number or type of data fields
- `int(...)` does not automatically trim preceding and trailing space characters. `int(" 123 ")` will fail.
- `bytes.fromhex(...)` does not automatically remove space characters. `bytes.fromhex("00 11\t")` will fail.
- `pow(x, y)` and `x ** y` do not work and fail when `y` is negative (floats are not supported in opshin)
- `x <= y <= z` (and all other chained comparisons) will evaluate `y` twice (the official semantic is to execute it only once). Note that this has practically no effect because the only side-effects in OpShin are traces/print statements.

Expand Down
2 changes: 1 addition & 1 deletion opshin/tests/test_builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def validator(x: int, y: bool, z: None) -> None:

@given(
i=st.one_of(
st.text(),
st.from_regex(r"[^\s]*", fullmatch=True),
st.builds(lambda x: x.hex(), st.binary()),
st.builds(lambda x: x.hex()[:-1], st.binary()),
st.builds(lambda x: x.hex().upper(), st.binary()),
Expand Down

0 comments on commit 75c3707

Please sign in to comment.