aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux.lux53
1 files changed, 47 insertions, 6 deletions
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux
index 63d468945..ca533e853 100644
--- a/stdlib/source/test/lux.lux
+++ b/stdlib/source/test/lux.lux
@@ -10,8 +10,7 @@
["@" target]
["." meta]
[abstract
- [monad (#+ do)]
- [predicate (#+ Predicate)]]
+ [monad (#+ do)]]
[control
["." io]
[concurrency
@@ -21,11 +20,13 @@
["." text ("#\." equivalence)
["%" format (#+ format)]]
[collection
- ["." list]]]
+ ["." list]
+ ["." set (#+ Set)]]]
["." macro
+ [syntax (#+ syntax:)]
["." code ("#\." equivalence)]]
["." math
- ["." random (#+ Random) ("#\." functor)]
+ ["." random ("#\." functor)]
[number
[i8 (#+)]
[i16 (#+)]
@@ -462,8 +463,7 @@
expected_left random.nat
expected_right random.nat
- #let [existential_type (: (Random /.Type)
- (\ ! map (|>> #.Ex) random.nat))]
+ #let [existential_type (\ ! map (|>> #.Ex) random.nat)]
expected/0 existential_type
expected/1 existential_type]
(<| (_.for [/.Type])
@@ -1051,6 +1051,46 @@
I16)))
)))
+(def: possible_targets
+ (Set @.Target)
+ (<| (set.of_list text.hash)
+ (list @.old
+ @.js
+ @.jvm
+ @.lua
+ @.python
+ @.ruby)))
+
+(syntax: (for_meta|Info)
+ (function (_ lux)
+ (let [info (get@ #.info lux)
+
+ conforming_target!
+ (set.member? ..possible_targets (get@ #.target info))
+
+ compiling!
+ (case (get@ #.mode info)
+ #.Build true
+ _ false)]
+ (#.Right [lux (list (code.bit (and conforming_target!
+ compiling!)))]))))
+
+(syntax: (for_meta|Module_State)
+ (do meta.monad
+ [prelude_module (meta.module .prelude_module)]
+ (in (list (code.bit (case (get@ #.module_state prelude_module)
+ #.Active false
+ _ true))))))
+
+(def: for_meta
+ Test
+ ($_ _.and
+ (_.cover [/.Mode /.Info]
+ (for_meta|Info))
+ (_.cover [/.Module_State]
+ (for_meta|Module_State))
+ ))
+
(def: test
Test
(<| (_.covering /._)
@@ -1076,6 +1116,7 @@
..for_control_flow
..for_def:
..for_import
+ ..for_meta
..sub_tests
)))