aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test/test/luxc/lang/synthesis/structure.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-05-26 19:49:18 -0400
committerEduardo Julian2018-05-26 19:49:18 -0400
commit223a2fad3a6140b942923fe43712ac0f7d8caf52 (patch)
tree9c95f08a849abfa75277415e26f2abcfe425741a /new-luxc/test/test/luxc/lang/synthesis/structure.lux
parent717ed15dc264d26a642adf22137fac6d526aff25 (diff)
- WIP: Migrated synthesis to stdlib.
Diffstat (limited to '')
-rw-r--r--new-luxc/test/test/luxc/lang/synthesis/structure.lux50
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)))
- ))))