diff options
Diffstat (limited to 'stdlib/source/spec/compositor/generation/structure.lux')
-rw-r--r-- | stdlib/source/spec/compositor/generation/structure.lux | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/stdlib/source/spec/compositor/generation/structure.lux b/stdlib/source/spec/compositor/generation/structure.lux index a93b27086..0697e5338 100644 --- a/stdlib/source/spec/compositor/generation/structure.lux +++ b/stdlib/source/spec/compositor/generation/structure.lux @@ -9,6 +9,7 @@ [data ["." maybe] [number + ["n" nat] ["i" int]] ["." text ("#@." equivalence) ["%" format (#+ format)]] @@ -30,9 +31,9 @@ (def: (variant run) (-> Runner Test) (do r.monad - [num-tags (|> r.nat (:: @ map (|>> (n/% 10) (n/max 2)))) - tag-in (|> r.nat (:: @ map (n/% num-tags))) - #let [last?-in (|> num-tags dec (n/= tag-in))] + [num-tags (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) + tag-in (|> r.nat (:: @ map (n.% num-tags))) + #let [last?-in (|> num-tags dec (n.= tag-in))] value-in r.i64] (_.test (%.name (name-of synthesis.variant)) (|> (synthesis.variant {#analysis.lefts (if last?-in @@ -43,11 +44,11 @@ (run "variant") (case> (#try.Success valueT) (let [valueT (:coerce (Array Any) valueT)] - (and (n/= 3 (array.size valueT)) + (and (n.= 3 (array.size valueT)) (let [tag-out (:coerce java/lang/Integer (maybe.assume (array.read 0 valueT))) last?-out (array.read 1 valueT) value-out (:coerce Any (maybe.assume (array.read 2 valueT))) - same-tag? (|> tag-out host.int-to-long (:coerce Nat) (n/= tag-in)) + same-tag? (|> tag-out host.int-to-long (:coerce Nat) (n.= tag-in)) same-flag? (case last?-out (#.Some last?-out') (and last?-in (text@= "" (:coerce Text last?-out'))) @@ -65,14 +66,14 @@ (def: (tuple run) (-> Runner Test) (do r.monad - [size (|> r.nat (:: @ map (|>> (n/% 10) (n/max 2)))) + [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) tuple-in (r.list size r.i64)] (_.test (%.name (name-of synthesis.tuple)) (|> (synthesis.tuple (list@map (|>> synthesis.i64) tuple-in)) (run "tuple") (case> (#try.Success tuple-out) (let [tuple-out (:coerce (Array Any) tuple-out)] - (and (n/= size (array.size tuple-out)) + (and (n.= size (array.size tuple-out)) (list.every? (function (_ [left right]) (i.= left (:coerce Int right))) (list.zip2 tuple-in (array.to-list tuple-out))))) |