aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2022-03-01 02:29:52 -0400
committerEduardo Julian2022-03-01 02:29:52 -0400
commit8023df0f5dae4638021fef7b8194a3d0a16b32e4 (patch)
tree8d64ad88decb0832d85b46a9ef7e734e6b816c35 /stdlib/source/test
parent62436b809630ecd3e40bd6e2b45a8870a2866934 (diff)
Still more fixes for JVM interop.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary/plist.lux7
-rw-r--r--stdlib/source/test/lux/tool.lux4
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/synthesis/side.lux43
3 files changed, 52 insertions, 2 deletions
diff --git a/stdlib/source/test/lux/data/collection/dictionary/plist.lux b/stdlib/source/test/lux/data/collection/dictionary/plist.lux
index aba318986..346dc5d77 100644
--- a/stdlib/source/test/lux/data/collection/dictionary/plist.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary/plist.lux
@@ -5,7 +5,8 @@
[abstract
[monad {"+" do}]
[\\specification
- ["$[0]" equivalence]]]
+ ["$[0]" equivalence]
+ ["$[0]" monoid]]]
[control
["[0]" maybe ("[1]#[0]" monad)]]
[data
@@ -47,6 +48,10 @@
(_.for [/.equivalence]
($equivalence.spec (/.equivalence n.equivalence)
(..random size gen_key random.nat)))
+ (_.for [/.monoid]
+ ($monoid.spec (/.equivalence n.equivalence)
+ /.monoid
+ (..random 10 (random.ascii/lower 1) random.nat)))
(_.cover [/.size]
(n.= size (/.size sample)))
diff --git a/stdlib/source/test/lux/tool.lux b/stdlib/source/test/lux/tool.lux
index c1b0a83bd..1009e3239 100644
--- a/stdlib/source/test/lux/tool.lux
+++ b/stdlib/source/test/lux/tool.lux
@@ -13,7 +13,8 @@
... ["[1][0]" syntax]
["[1][0]" analysis]
["[1][0]" synthesis "_"
- ["[1]/[0]" simple]]
+ ["[1]/[0]" simple]
+ ["[1]/[0]" side]]
["[1][0]" phase "_"
["[1]/[0]" extension]
["[1]/[0]" analysis]
@@ -37,6 +38,7 @@
/phase.test
/analysis.test
/synthesis/simple.test
+ /synthesis/side.test
/meta/archive.test
/meta/cli.test
/meta/export.test
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/synthesis/side.lux b/stdlib/source/test/lux/tool/compiler/language/lux/synthesis/side.lux
new file mode 100644
index 000000000..3dccec159
--- /dev/null
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/synthesis/side.lux
@@ -0,0 +1,43 @@
+(.using
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" hash]]]
+ [data
+ ["[0]" bit ("[1]#[0]" equivalence)]
+ ["[0]" text ("[1]#[0]" equivalence)]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" /]])
+
+(def: .public random
+ (Random /.Side)
+ ($_ random.and
+ random.nat
+ random.bit
+ ))
+
+(def: .public test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Side])
+ (do [! random.monad]
+ [left ..random
+ right ..random]
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ (_.for [/.hash]
+ ($hash.spec /.hash ..random))
+
+ (_.cover [/.format]
+ (bit#= (# /.equivalence = left right)
+ (text#= (/.format left) (/.format right))))
+ ))))