From edb0485c12d02a622e2f45f19c8cfd87b818facf Mon Sep 17 00:00:00 2001 From: Llewellyn Falco Date: Sun, 14 Apr 2024 20:34:41 +0000 Subject: [PATCH] . t test double transform Co-Authored-By: 4dsherwood <4dsherwood@users.noreply.github.com> Co-Authored-By: Nitsan Avni Co-Authored-By: Susan Fung <38925660+susanfung@users.noreply.github.com> Co-Authored-By: T. E. Green <78671457+Tegsy@users.noreply.github.com> --- tests/test_parse_inputs.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_parse_inputs.py b/tests/test_parse_inputs.py index c2d0acf..d5c952d 100644 --- a/tests/test_parse_inputs.py +++ b/tests/test_parse_inputs.py @@ -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): @@ -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