diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/target/python.lux | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/stdlib/source/test/lux/target/python.lux b/stdlib/source/test/lux/target/python.lux index 6eed5ecab..45eae7e38 100644 --- a/stdlib/source/test/lux/target/python.lux +++ b/stdlib/source/test/lux/target/python.lux @@ -329,8 +329,12 @@ (do [! random.monad] [expected/0 random.safe_frac expected/1 random.safe_frac - choice (# ! each (n.% 2) random.nat) - .let [expected/? (case choice + poly_choice (# ! each (n.% 2) random.nat) + .let [keyword (|>> %.nat (format "k") /.string) + keyword/0 (keyword 0) + keyword/1 (keyword 1) + keyword_choice (keyword poly_choice)] + .let [expected/? (case poly_choice 0 expected/0 _ expected/1)] $var (# ! each (|>> %.nat (format "v") /.var) random.nat) @@ -344,9 +348,28 @@ (expression (|>> (:as Frac) (f.= expected/?)) (/.apply/* (/.lambda (list $choice (/.poly $var)) (/.item $choice $var)) - (list (/.int (.int choice)) + (list (/.int (.int poly_choice)) (/.float expected/0) (/.float expected/1))))) + (_.for [/.Keyword /.KVar] + ($_ _.and + (_.cover [/.keyword] + (expression (|>> (:as Nat) (n.= 2)) + (/.apply/* (/.lambda (list $choice (/.keyword $var)) + (/.len/1 $var)) + (list keyword_choice + (/.splat_keyword + (/.dict (list [keyword/0 (/.float expected/0)] + [keyword/1 (/.float expected/1)]))))))) + (_.cover [/.splat_keyword] + (expression (|>> (:as Frac) (f.= expected/?)) + (/.apply/* (/.lambda (list $choice (/.keyword $var)) + (/.item $choice $var)) + (list keyword_choice + (/.splat_keyword + (/.dict (list [keyword/0 (/.float expected/0)] + [keyword/1 (/.float expected/1)]))))))) + )) ))) (def: test|expression |