From 8023df0f5dae4638021fef7b8194a3d0a16b32e4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 1 Mar 2022 02:29:52 -0400 Subject: Still more fixes for JVM interop. --- .../test/lux/data/collection/dictionary/plist.lux | 7 +++- stdlib/source/test/lux/tool.lux | 4 +- .../tool/compiler/language/lux/synthesis/side.lux | 43 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 stdlib/source/test/lux/tool/compiler/language/lux/synthesis/side.lux (limited to 'stdlib/source/test') 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)))) + )))) -- cgit v1.2.3