Skip to content

Commit

Permalink
Create test_values.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed Jun 5, 2024
1 parent 10adfc5 commit c5fff05
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/tests/test_values.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pyoload import *
import pyoload


assert pyoload.__version__ == '2.0.0'


@annotate
def odd(a: Values(range(10))) -> bool:
return a % 2 == 1


def test_values():
assert odd(3), '3 reported not odd'
assert not odd(2), '2 reported odd'

try:
odd(10)
except AnnotationError:
pass
else:
raise AssertionError('Values did not crash')

0 comments on commit c5fff05

Please sign in to comment.