aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world
diff options
context:
space:
mode:
authorEduardo Julian2022-10-27 00:00:03 -0400
committerEduardo Julian2022-10-27 00:00:03 -0400
commit54d22bc41b874d52a94a96aafca18ab3a6357edb (patch)
treef8560699f618eabbc25a621e9d62f0bc000b2125 /stdlib/source/test/lux/world
parent8d4c256f8b56561869c14df02db695d774c74fa6 (diff)
Added support for aspect-oriented programming.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r--stdlib/source/test/lux/world/net.lux4
-rw-r--r--stdlib/source/test/lux/world/net/uri/query.lux43
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))
+ )))