From 8832a22b305b2c37735663f0bf56b4bf99e963ec Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 28 Feb 2016 20:32:29 -0500 Subject: [PATCH] Add a failing test case to comprehensions.rkt --- prospect/comprehensions.rkt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/prospect/comprehensions.rkt b/prospect/comprehensions.rkt index 6d11962..46f1183 100644 --- a/prospect/comprehensions.rkt +++ b/prospect/comprehensions.rkt @@ -111,7 +111,18 @@ (for/fold ([acc (trie-empty)]) ([v (in-list vs)]) (trie-union acc (pattern->trie 'a v)))) - + + (struct foo (bar zot) #:prefab) + + ;; This test should pass OK, since we're ignoring all the infinite + ;; dimensions, and just projecting out a finite one. + (check-equal? (for-trie/set ([(observe (foo $bar _)) + (make-trie (observe (foo 1 'a)) + (observe (foo 2 'b)) + (observe (foo 3 ?)))]) + bar) + (set 1 2 3)) + (check-equal? (for-trie/list ([$x (make-trie 1 2 3 4)] #:where (even? x)) (+ x 1))