Skip to content

Commit

Permalink
. t test double transform
Browse files Browse the repository at this point in the history
Co-Authored-By: 4dsherwood <4dsherwood@users.noreply.github.com>
Co-Authored-By: Nitsan Avni <nitsanav@gmail.com>
Co-Authored-By: Susan Fung <38925660+susanfung@users.noreply.github.com>
Co-Authored-By: T. E. Green <78671457+Tegsy@users.noreply.github.com>
  • Loading branch information
5 people committed Apr 14, 2024
1 parent 10a0da5 commit edb0485
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/test_parse_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ def test_with_3_parameters():
a, 3, 1 -> aaaa
"""

def to_int(s: str, t: type = str):
assert type(s) is t
return int(s)


counter = 0
def to(tin: type, tout: type):
def wrapped(input):
Expand All @@ -136,8 +133,10 @@ def wrapped(input):
return wrapped

parse = Parse.doc_string(auto_approve=True)
parse.transform3( to(str, str), to(str, int), to(str, int)).verify_all(lambda a, b, c: to(str, str)(a) * (to(int, int)(b) + to(int, int)(c)))
parse.transform3( to(str, str), to(str, str), to(str, str))\
.transform3( to(str, str), to(str, int), to(str, int))\
.verify_all(lambda a, b, c: to(str, str)(a) * (to(int, int)(b) + to(int, int)(c)))

assert counter == 6
assert counter == 9

# assert on all the paramaters

0 comments on commit edb0485

Please sign in to comment.