Add a failing test case to comprehensions.rkt

This commit is contained in:
Tony Garnock-Jones 2016-02-28 20:32:29 -05:00
parent cd492df0c4
commit 8832a22b30
1 changed files with 12 additions and 1 deletions

View File

@ -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))