diff options
Diffstat (limited to 'new-luxc/test/test/luxc/lang/synthesis/structure.lux')
-rw-r--r-- | new-luxc/test/test/luxc/lang/synthesis/structure.lux | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/new-luxc/test/test/luxc/lang/synthesis/structure.lux b/new-luxc/test/test/luxc/lang/synthesis/structure.lux deleted file mode 100644 index 46c9bf2a1..000000000 --- a/new-luxc/test/test/luxc/lang/synthesis/structure.lux +++ /dev/null @@ -1,50 +0,0 @@ -(.module: - lux - (lux [io] - (control [monad #+ do] - pipe) - (data [bool "B/" Eq<Bool>] - [product] - (coll [list])) - ["r" math/random "r/" Monad<Random>] - test) - (luxc (lang ["la" analysis] - ["ls" synthesis] - (synthesis [".S" expression]) - [".L" extension])) - (// common)) - -(context: "Variants" - (<| (times +100) - (do @ - [size (|> r.nat (:: @ map (|>> (n/% +10) (n/max +2)))) - tagA (|> r.nat (:: @ map (n/% size))) - memberA gen-primitive] - ($_ seq - (test "Can synthesize variants." - (|> (expressionS.synthesize extensionL.no-syntheses (la.sum tagA size +0 memberA)) - (case> (^ [_ (#.Form (list [_ (#.Nat tagS)] [_ (#.Bool last?S)] memberS))]) - (and (n/= tagA tagS) - (B/= (n/= (n/dec size) tagA) - last?S) - (corresponds? memberA memberS)) - - _ - false))) - )))) - -(context: "Tuples" - (<| (times +100) - (do @ - [size (|> r.nat (:: @ map (|>> (n/% +10) (n/max +2)))) - membersA (r.list size gen-primitive)] - ($_ seq - (test "Can synthesize tuple." - (|> (expressionS.synthesize extensionL.no-syntheses (la.product membersA)) - (case> [_ (#.Tuple membersS)] - (and (n/= size (list.size membersS)) - (list.every? (product.uncurry corresponds?) (list.zip2 membersA membersS))) - - _ - false))) - )))) |