From 44511b3c9870e2a4138e6ffcc80479df94f081cd Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 13 Sep 2024 14:13:17 -0700 Subject: [PATCH] Tests for bindings issues identified in #181 One of these was resolved by the upgrade to syntax-spec-v2. Tests for the remaining issues are left commented out. --- qi-test/tests/flow.rkt | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/qi-test/tests/flow.rkt b/qi-test/tests/flow.rkt index 5218767a7..a1028004f 100644 --- a/qi-test/tests/flow.rkt +++ b/qi-test/tests/flow.rkt @@ -459,8 +459,32 @@ "Racket functions named `as` aren't clobbered") (check-equal? ((☯ (~> (esc (lambda (v) (as v))))) 3) 3 - "Racket functions named `as` aren't clobbered"))) - + "Racket functions named `as` aren't clobbered")) + (test-equal? "binding used in Racket expr position" + ((☯ (~> (as p) (gen p))) 5) + 5) + (test-equal? "binding used in Racket expr position" + ((☯ (~> (as p) (gen p))) odd?) + odd?) + (test-equal? "binding a value used in a Racket expr position as a function" + ((☯ (~>> (as p) + (range 10) + (filter p))) + odd?) + (list 1 3 5 7 9)) + ;; See issue #181 + ;; (test-equal? "binding a value used in a floe position" + ;; ((☯ (~> (as p) + ;; (range 10) + ;; △ + ;; (pass p) + ;; ▽)) + ;; odd?) + ;; (list 1 3 5 7 9)) + ;; (test-exn "using a qi binding as a primitive flow" + ;; exn:fail:contract:arity? + ;; (thunk ((☯ (~> (as p) p)) odd?))) + ) (test-suite "routing forms" (test-suite