diff options
Diffstat (limited to 'stdlib/source/test/lux/meta.lux')
-rw-r--r-- | stdlib/source/test/lux/meta.lux | 262 |
1 files changed, 139 insertions, 123 deletions
diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index ea47a6fc7..8ae07efb8 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -1,45 +1,54 @@ -(.require - [library - [lux (.except) - ["_" test (.only Test)] - [abstract - [equivalence (.only Equivalence)] - [monad (.only do)] - [\\specification - ["$[0]" functor (.only Injection Comparison)] - ["$[0]" apply] - ["$[0]" monad]]] - [control - ["[0]" maybe] - ["[0]" try (.only Try) (.use "[1]#[0]" functor)]] - [data - ["[0]" product] - ["[0]" bit (.use "[1]#[0]" equivalence)] - ["[0]" text (.use "[1]#[0]" equivalence) - ["%" \\format (.only format)]] - [collection - ["[0]" list (.use "[1]#[0]" functor monoid)] - ["[0]" set]]] - [math - ["[0]" random (.only Random)] - [number - ["n" nat]]] - [meta - ["[0]" location] - ["[0]" symbol (.use "[1]#[0]" equivalence)] - [macro - ["^" pattern]]]]] - [\\library - ["[0]" / (.only) - ["[0]" type (.use "[1]#[0]" equivalence)]]] - ["[0]" / - ["[1][0]" code] - ["[1][0]" location] - ["[1][0]" symbol] - ["[1][0]" configuration] - ["[1][0]" version] - ["[1][0]" type] - ["[1][0]" macro]]) +(.`` (.`` (.require + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [equivalence (.only Equivalence)] + [monad (.only do)] + [\\specification + ["$[0]" functor (.only Injection Comparison)] + ["$[0]" apply] + ["$[0]" monad]]] + [control + ["[0]" maybe] + ["[0]" try (.only Try) (.use "[1]#[0]" functor)]] + [data + ["[0]" product] + ["[0]" bit (.use "[1]#[0]" equivalence)] + ["[0]" text (.use "[1]#[0]" equivalence) + ["%" \\format (.only format)]] + [collection + ["[0]" list (.use "[1]#[0]" functor monoid)] + ["[0]" set]]] + [math + ["[0]" random (.only Random)] + [number + ["n" nat]]] + [meta + ["@" target] + ["[0]" location] + ["[0]" symbol (.use "[1]#[0]" equivalence)] + [macro + ["^" pattern]]]]] + [\\library + ["[0]" / (.only) + ["[0]" type (.use "[1]#[0]" equivalence)]]] + ["[0]" / + ["[1][0]" code] + ["[1][0]" location] + ["[1][0]" symbol] + ["[1][0]" configuration] + ["[1][0]" version] + ["[1][0]" type] + ["[1][0]" macro] + ["[1][0]" target (.only) + (.,, (.for "{old}" (.,, (.these ["[1]/[0]" jvm])) + "JVM" (.,, (.these ["[1]/[0]" jvm])) + "JavaScript" (.,, (.these ["[1]/[0]" js])) + "Lua" (.,, (.these ["[1]/[0]" lua])) + "Python" (.,, (.these ["[1]/[0]" python])) + "Ruby" (.,, (.these ["[1]/[0]" ruby])) + (.,, (.these))))]]))) (def !expect (template (_ <pattern> <value>) @@ -945,85 +954,92 @@ _ false))) -(def .public test - Test - (<| (_.covering /._) - (_.for [.Meta .Lux]) - (all _.and - (do [! random.monad] - [target (random.upper_case 1) - version (random.upper_case 1) - source_code (random.upper_case 1) - expected_current_module (random.upper_case 1) - expected_type (at ! each (function (_ name) - {.#Primitive name (list)}) - (random.upper_case 1)) - expected_seed random.nat - expected random.nat - dummy (random.only (|>> (n.= expected) not) random.nat) - expected_location ..random_location - .let [expected_lux [.#info [.#target target - .#version version - .#mode {.#Build} - .#configuration (list)] - .#source [expected_location 0 source_code] - .#location expected_location - .#current_module {.#Some expected_current_module} - .#modules (list) - .#scopes (list) - .#type_context [.#ex_counter 0 - .#var_counter 0 - .#var_bindings (list)] - .#expected {.#Some expected_type} - .#seed expected_seed - .#scope_type_vars (list) - .#extensions [] - .#eval (as (-> Type Code (Meta Any)) []) - .#host []]]] - (all _.and - (_.for [/.functor] - ($functor.spec ..injection (..comparison expected_lux) /.functor)) - (_.for [/.apply] - ($apply.spec ..injection (..comparison expected_lux) /.apply)) - (_.for [/.monad] - ($monad.spec ..injection (..comparison expected_lux) /.monad)) +(`` (`` (def .public test + Test + (<| (_.covering /._) + (_.for [.Meta .Lux]) + (all _.and + (do [! random.monad] + [target (random.upper_case 1) + version (random.upper_case 1) + source_code (random.upper_case 1) + expected_current_module (random.upper_case 1) + expected_type (at ! each (function (_ name) + {.#Primitive name (list)}) + (random.upper_case 1)) + expected_seed random.nat + expected random.nat + dummy (random.only (|>> (n.= expected) not) random.nat) + expected_location ..random_location + .let [expected_lux [.#info [.#target target + .#version version + .#mode {.#Build} + .#configuration (list)] + .#source [expected_location 0 source_code] + .#location expected_location + .#current_module {.#Some expected_current_module} + .#modules (list) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#Some expected_type} + .#seed expected_seed + .#scope_type_vars (list) + .#extensions [] + .#eval (as (-> Type Code (Meta Any)) []) + .#host []]]] + (all _.and + (_.for [/.functor] + ($functor.spec ..injection (..comparison expected_lux) /.functor)) + (_.for [/.apply] + ($apply.spec ..injection (..comparison expected_lux) /.apply)) + (_.for [/.monad] + ($monad.spec ..injection (..comparison expected_lux) /.monad)) - (do random.monad - [expected_value random.nat - expected_error (random.upper_case 1)] - (_.coverage [/.lifted] - (and (|> expected_error - {try.#Failure} - (is (Try Nat)) - /.lifted - (/.result expected_lux) - (!expect (^.multi {try.#Failure actual} - (text#= (location.with expected_location expected_error) - actual)))) - (|> expected_value - {try.#Success} - (is (Try Nat)) - /.lifted - (/.result expected_lux) - (!expect (^.multi {try.#Success actual} - (same? expected_value actual))))))) - - ..compiler_related - ..error_handling - ..module_related - ..context_related - ..definition_related - ..search_related - ..locals_related - (_.for [.Label] - ..label_related) - )) - - /code.test - /location.test - /symbol.test - /configuration.test - /version.test - /type.test - /macro.test - ))) + (do random.monad + [expected_value random.nat + expected_error (random.upper_case 1)] + (_.coverage [/.lifted] + (and (|> expected_error + {try.#Failure} + (is (Try Nat)) + /.lifted + (/.result expected_lux) + (!expect (^.multi {try.#Failure actual} + (text#= (location.with expected_location expected_error) + actual)))) + (|> expected_value + {try.#Success} + (is (Try Nat)) + /.lifted + (/.result expected_lux) + (!expect (^.multi {try.#Success actual} + (same? expected_value actual))))))) + + ..compiler_related + ..error_handling + ..module_related + ..context_related + ..definition_related + ..search_related + ..locals_related + (_.for [.Label] + ..label_related) + )) + + /code.test + /location.test + /symbol.test + /configuration.test + /version.test + /type.test + /macro.test + /target.test + (,, (for @.jvm (,, (these /target/jvm.test)) + @.old (,, (these /target/jvm.test)) + @.js (,, (these /target/js.test)) + @.lua (,, (these /target/lua.test)) + @.python (,, (these /target/python.test)) + @.ruby (,, (these /target/ruby.test)))) + ))))) |