diff options
author | Eduardo Julian | 2022-10-27 00:00:03 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-10-27 00:00:03 -0400 |
commit | 54d22bc41b874d52a94a96aafca18ab3a6357edb (patch) | |
tree | f8560699f618eabbc25a621e9d62f0bc000b2125 /stdlib/source/test/lux/world | |
parent | 8d4c256f8b56561869c14df02db695d774c74fa6 (diff) |
Added support for aspect-oriented programming.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r-- | stdlib/source/test/lux/world/net.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/uri/query.lux | 43 |
2 files changed, 46 insertions, 1 deletions
diff --git a/stdlib/source/test/lux/world/net.lux b/stdlib/source/test/lux/world/net.lux index 9856b8a00..b2c286fc0 100644 --- a/stdlib/source/test/lux/world/net.lux +++ b/stdlib/source/test/lux/world/net.lux @@ -20,7 +20,8 @@ ["[1][0]" uri ["[1]/[0]" encoding] ["[1]/[0]" scheme] - ["[1]/[0]" path]]]) + ["[1]/[0]" path] + ["[1]/[0]" query]]]) (def .public test Test @@ -48,4 +49,5 @@ /uri/encoding.test /uri/scheme.test /uri/path.test + /uri/query.test ))) diff --git a/stdlib/source/test/lux/world/net/uri/query.lux b/stdlib/source/test/lux/world/net/uri/query.lux new file mode 100644 index 000000000..ecdd3c2c4 --- /dev/null +++ b/stdlib/source/test/lux/world/net/uri/query.lux @@ -0,0 +1,43 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)] + [\\specification + ["[0]S" equivalence] + ["[0]S" codec]]] + [data + [collection + ["[0]" dictionary]]] + [math + ["[0]" random (.only Random) (.use "[1]#[0]" monad)]] + [test + ["_" property (.only Test)]]]] + [\\library + ["[0]" /]]) + +(def .public (random size) + (-> Nat (Random /.Query)) + (when size + 0 (random#in /.empty) + _ (do random.monad + [key (random.alphabetic size) + value (random.unicode size) + query (random (-- size))] + (in (dictionary.has key value query))))) + +(def .public test + Test + (<| (_.covering /._) + (do [! random.monad] + []) + (_.for [/.Query]) + (all _.and + (_.for [/.equivalence] + (equivalenceS.spec /.equivalence (..random 2))) + (_.for [/.codec] + (codecS.spec /.equivalence /.codec (..random 3))) + + (_.coverage [/.empty] + (dictionary.empty? /.empty)) + ))) |