aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2022-08-17 17:15:18 -0400
committerEduardo Julian2022-08-17 17:15:18 -0400
commit3b2d67a9679499b6ec9cbd781d2bf55396719136 (patch)
tree6d1da39f8d12dc18bc345cb93e636ff77c6cbd97 /stdlib/source/test
parent52806bc618b7eee43bb1aa1300247c92e05b7ab1 (diff)
Less needless re-compilation in the caching system.
Diffstat (limited to 'stdlib/source/test')
-rw-r--r--stdlib/source/test/lux.lux165
-rw-r--r--stdlib/source/test/lux/ffi.js.lux45
-rw-r--r--stdlib/source/test/lux/ffi/node_js.js.lux42
3 files changed, 148 insertions, 104 deletions
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux
index 03ec5b64f..58528f019 100644
--- a/stdlib/source/test/lux.lux
+++ b/stdlib/source/test/lux.lux
@@ -1,63 +1,62 @@
-(.`` (.`` (.require
- [library
- ["/" lux (.except)
- [program (.only program)]
- [abstract
- [monad (.only do)]]
- [control
- ["[0]" io]
- ["[0]" maybe (.use "[1]#[0]" functor)]
- [concurrency
- ["[0]" atom (.only Atom)]]]
- [data
- ["[0]" product]
- ["[0]" bit (.use "[1]#[0]" equivalence)]
- ["[0]" text (.use "[1]#[0]" equivalence)
- ["%" \\format (.only format)]]
- [collection
- ["[0]" set (.only Set) (.use "[1]#[0]" equivalence)]
- ["[0]" list (.use "[1]#[0]" functor)
- ["[0]" property]]]]
- ["[0]" math
- ["[0]" random (.use "[1]#[0]" functor)]
- [number
- [i8 (.only)]
- [i16 (.only)]
- ["n" nat]
- ["i" int]
- ["r" rev]
- ["f" frac]
- ["[0]" i64]]]
- ["[0]" meta (.use "[1]#[0]" monad)
- ["@" target]
- ["[0]" static]
- ["[0]" location (.use "[1]#[0]" equivalence)]
- ["[0]" code (.use "[1]#[0]" equivalence)
- ["<[1]>" \\parser]]
- ["[0]" macro (.only)
- [syntax (.only syntax)]
- ["^" pattern]
- ["[0]" template]]]
- [test
- ["_" property (.only Test)]]]]
- ... TODO: Must have 100% coverage on tests.
- ["[0]" /
- ["[1][0]" abstract]
- ["[1][0]" control]
- ["[1][0]" data]
- ["[1][0]" debug]
-
- ["[1][0]" documentation]
- ["[1][0]" math]
-
- ["[1][0]" meta]
- ["[1][0]" program]
- ["[1][0]" test/property]
-
- ["[1][0]" world]
-
- ["[1][0]" ffi]
- ])))
+(.require
+ [library
+ ["/" lux (.except)
+ [program (.only program)]
+ [abstract
+ [monad (.only do)]]
+ [control
+ ["[0]" io]
+ ["[0]" maybe (.use "[1]#[0]" functor)]
+ [concurrency
+ ["[0]" atom (.only Atom)]]]
+ [data
+ ["[0]" product]
+ ["[0]" bit (.use "[1]#[0]" equivalence)]
+ ["[0]" text (.use "[1]#[0]" equivalence)
+ ["%" \\format (.only format)]]
+ [collection
+ ["[0]" set (.only Set) (.use "[1]#[0]" equivalence)]
+ ["[0]" list (.use "[1]#[0]" functor)
+ ["[0]" property]]]]
+ ["[0]" math
+ ["[0]" random (.use "[1]#[0]" functor)]
+ [number
+ [i8 (.only)]
+ [i16 (.only)]
+ ["n" nat]
+ ["i" int]
+ ["r" rev]
+ ["f" frac]
+ ["[0]" i64]]]
+ ["[0]" meta (.use "[1]#[0]" monad)
+ ["@" target]
+ ["[0]" static]
+ ["[0]" location (.use "[1]#[0]" equivalence)]
+ ["[0]" code (.use "[1]#[0]" equivalence)
+ ["<[1]>" \\parser]]
+ ["[0]" macro (.only)
+ [syntax (.only syntax)]
+ ["^" pattern]
+ ["[0]" template]]]
+ [test
+ ["_" property (.only Test)]]]]
+ ... TODO: Must have 100% coverage on tests.
+ ["[0]" /
+ ["[1][0]" abstract]
+ ["[1][0]" control]
+ ["[1][0]" data]
+ ["[1][0]" debug]
+
+ ["[1][0]" documentation]
+ ["[1][0]" math]
+
+ ["[1][0]" meta]
+ ["[1][0]" program]
+ ["[1][0]" test/property]
+
+ ["[1][0]" world]
+
+ ["[1][0]" ffi]])
(def for_bit
Test
@@ -1165,29 +1164,29 @@
Test
(`` (`` (all _.and
..for_bit
- ..for_try
- ..for_list
- ..for_interface
- ..for_module
- ..for_pipe
- ..for_code
- ..for_macro
- ..for_type
- ..for_i64
- ..for_function
- ..for_template
- ..for_static
- ..for_slot
- ..for_associative
- ..for_expansion
- ..for_value
- ..for_when
- ..for_control_flow
- ..for_def
- ..for_meta
- ..for_export
- (,, (for @.old (,, (these))
- (,, (these ..for_bindings))))
+ ... ..for_try
+ ... ..for_list
+ ... ..for_interface
+ ... ..for_module
+ ... ..for_pipe
+ ... ..for_code
+ ... ..for_macro
+ ... ..for_type
+ ... ..for_i64
+ ... ..for_function
+ ... ..for_template
+ ... ..for_static
+ ... ..for_slot
+ ... ..for_associative
+ ... ..for_expansion
+ ... ..for_value
+ ... ..for_when
+ ... ..for_control_flow
+ ... ..for_def
+ ... ..for_meta
+ ... ..for_export
+ ... (,, (for @.old (,, (these))
+ ... (,, (these ..for_bindings))))
))))
(def test
diff --git a/stdlib/source/test/lux/ffi.js.lux b/stdlib/source/test/lux/ffi.js.lux
index 6148aa47f..2a5748483 100644
--- a/stdlib/source/test/lux/ffi.js.lux
+++ b/stdlib/source/test/lux/ffi.js.lux
@@ -1,24 +1,26 @@
-(.require
- [library
- [lux (.except)
- [abstract
- [monad (.only do)]]
- [control
- ["[0]" try]]
- [data
- ["[0]" bit (.use "[1]#[0]" equivalence)]
- ["[0]" text (.use "[1]#[0]" equivalence)]]
- [math
- ["[0]" random (.only Random)]
- [number
- ["[0]" nat]
- ["[0]" frac]]]
- [test
- ["_" property (.only Test)]]]]
- [\\library
- ["[0]" /]]
- ["$[0]" /
- ["[1][0]" export]])
+(.`` (.`` (.require
+ [library
+ [lux (.except)
+ [abstract
+ [monad (.only do)]]
+ [control
+ ["[0]" try]]
+ [data
+ ["[0]" bit (.use "[1]#[0]" equivalence)]
+ ["[0]" text (.use "[1]#[0]" equivalence)]]
+ [math
+ ["[0]" random (.only Random)]
+ [number
+ ["[0]" nat]
+ ["[0]" frac]]]
+ [test
+ ["_" property (.only Test)]]]]
+ [\\library
+ ["[0]" /]]
+ ["$[0]" /
+ ["[1][0]" export]
+ (.,, (.for "JavaScript" (.,, (.these ["[1][0]" node_js]))
+ (.,, (.these))))])))
(/.import Uint8Array
"[1]::[0]")
@@ -164,4 +166,5 @@
(/.undefined? ("js object get" "my_yolo" it)))))
$/export.test
+ $/node_js.test
)))))
diff --git a/stdlib/source/test/lux/ffi/node_js.js.lux b/stdlib/source/test/lux/ffi/node_js.js.lux
new file mode 100644
index 000000000..82aff3f75
--- /dev/null
+++ b/stdlib/source/test/lux/ffi/node_js.js.lux
@@ -0,0 +1,42 @@
+(.require
+ [library
+ [lux (.except)
+ [abstract
+ [monad (.only do)]]
+ [control
+ ["[0]" try]
+ ["[0]" exception]]
+ [math
+ ["[0]" random]]
+ [test
+ ["_" property (.only Test)]]]]
+ [\\library
+ ["[0]" /]])
+
+(def .public test
+ Test
+ (do [! random.monad]
+ [real_module (all random.either
+ (in "buffer")
+ (in "fs")
+ (in "net")
+ (in "os"))
+ fake_module (random.upper_case 1)]
+ (<| (_.covering /._)
+ (all _.and
+ (_.coverage [/.require]
+ (when [(/.require real_module)
+ (/.require real_module)]
+ [{try.#Success left} {try.#Success right}]
+ (same? left right)
+
+ _
+ false))
+ (_.coverage [/.cannot_require]
+ (when (/.require fake_module)
+ {try.#Failure error}
+ (exception.match? /.cannot_require error)
+
+ _
+ false))
+ ))))