diff options
Diffstat (limited to 'stdlib/source/test')
97 files changed, 470 insertions, 438 deletions
diff --git a/stdlib/source/test/aedifex/artifact/extension.lux b/stdlib/source/test/aedifex/artifact/extension.lux index d8bfd8267..7ca90b6a6 100644 --- a/stdlib/source/test/aedifex/artifact/extension.lux +++ b/stdlib/source/test/aedifex/artifact/extension.lux @@ -30,7 +30,7 @@ (n.= (list.size options) (set.size uniques)))) (_.coverage [/.extension /.type] - (`` (and (~~ (template [<type> <extension>] + (`` (and (~~ (with_template [<type> <extension>] [(and (text#= <extension> (/.extension <type>)) (text#= <type> diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index 25302fa71..c740ad48f 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -115,7 +115,7 @@ ///dependency.#type ///artifact/type.js_library]]] (`` (all random.either (in js_compiler) - (~~ (template [<compiler>] + (~~ (with_template [<compiler>] [(in [///dependency.#artifact [///artifact.#group /.lux_group ///artifact.#name <compiler> ///artifact.#version lux_version] @@ -219,7 +219,7 @@ expected/1 (random.alphabetic 5) expected/2 (random.alphabetic 5)] (`` (all _.and - (~~ (template [<error?> <log!>] + (~~ (with_template [<error?> <log!>] [(let [console (@version.echo "") shell (|> (list expected/0 expected/1 expected/2) (..reader_shell <error?>) diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index aeeb49cb2..31cd54fad 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -271,7 +271,7 @@ {try.#Failure _} false)))) - (~~ (template [<exception> <bad>] + (~~ (with_template [<exception> <bad>] [(in (do async.monad [actual_package (/.one (///repository.mock <bad> []) [///dependency.#artifact expected_artifact diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index dfa36217b..921461cf8 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -45,7 +45,7 @@ )) (_.for [/.data] (all _.and - (~~ (template [<hash> <constructor> <exception>] + (~~ (with_template [<hash> <constructor> <exception>] [(do random.monad [expected (..random <hash>)] (_.coverage [<hash> <constructor> <exception>] @@ -67,7 +67,7 @@ [/.sha-1 /.as_sha-1 /.not_a_sha-1] [/.md5 /.as_md5 /.not_a_md5] )))) - (~~ (template [<codec> <hash>] + (~~ (with_template [<codec> <hash>] [(_.for [<codec>] ($codec.spec /.equivalence <codec> (..random <hash>)))] @@ -76,7 +76,7 @@ )) (_.for [/.not_a_hash] (all _.and - (~~ (template [<codec> <hash>] + (~~ (with_template [<codec> <hash>] [(do random.monad [expected (..random <hash>)] (_.coverage [<codec>] diff --git a/stdlib/source/test/aedifex/runtime.lux b/stdlib/source/test/aedifex/runtime.lux index a1ba22588..58d539584 100644 --- a/stdlib/source/test/aedifex/runtime.lux +++ b/stdlib/source/test/aedifex/runtime.lux @@ -41,7 +41,7 @@ (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) - (~~ (template [<command>] + (~~ (with_template [<command>] [(_.coverage [/.default_java /.default_js /.default_python /.default_lua /.default_ruby] (let [listing (|> (list /.default_java /.default_js /.default_python /.default_lua /.default_ruby) (list#each (the /.#program))) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 056d93079..0d393c2c2 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -429,7 +429,7 @@ <m2/1> (template.text [<module/2> "/" <module/1>]) <m0/1/2> (template.text [<module/0> "/" <module/1> "/" <module/2>]) <open/0> (template.text [<module/0> "#[0]"])] - (and (~~ (template [<input> <module> <referrals>] + (and (~~ (with_template [<input> <module> <referrals>] [(with_expansions [<input>' (macro.final <input>)] (let [scenario (is (-> Any Bit) (function (_ _) @@ -657,14 +657,15 @@ (n.= (n.* (++ expected_left) (-- expected_right)) (actual [expected_left expected_right]))))))) -(/.template: (!n/+ <left> <right>) - [(n.+ <left> <right>)]) +(def: !n/+ + (/.template (_ <left> <right>) + [(n.+ <left> <right>)])) (def: for_template Test (`` (all _.and - (_.coverage [/.template] - (let [bits (list (~~ (/.template [_] + (_.coverage [/.with_template] + (let [bits (list (~~ (/.with_template [_] [true] [0] [1] [2] @@ -674,7 +675,7 @@ (do random.monad [left random.nat right random.nat] - (_.coverage [/.template:] + (_.coverage [/.template] (n.= (n.+ left right) (!n/+ left right)))) ))) @@ -943,9 +944,10 @@ [#left l #right r])) -(template: (!pair <left> <right>) - [[..#left <left> - ..#right <right>]]) +(def: !pair + (template (_ <left> <right>) + [[..#left <left> + ..#right <right>]])) (def: for_case Test diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux index 18387288e..9917756e8 100644 --- a/stdlib/source/test/lux/abstract/interval.lux +++ b/stdlib/source/test/lux/abstract/interval.lux @@ -20,7 +20,7 @@ [\\library ["[0]" / (.only Interval) (.open: "[1]#[0]" equivalence)]]) -(template [<name> <cmp>] +(with_template [<name> <cmp>] [(def: .public <name> (Random (Interval Nat)) (do random.monad diff --git a/stdlib/source/test/lux/control/concatenative.lux b/stdlib/source/test/lux/control/concatenative.lux index 825228c31..354cc744a 100644 --- a/stdlib/source/test/lux/control/concatenative.lux +++ b/stdlib/source/test/lux/control/concatenative.lux @@ -65,7 +65,7 @@ /.&&)] (and (n.= sample left) (n.= dummy right)))) - (~~ (template [<function> <tag>] + (~~ (with_template [<function> <tag>] [(_.coverage [<function>] ((sum.equivalence n.= n.=) {<tag> sample} @@ -91,31 +91,32 @@ /.drop /.drop))) )))) -(template: (!numerical <=> <generator> <only> <arithmetic> <order>) - [(is Test - (with_expansions [<arithmetic>' (template.spliced <arithmetic>) - <order>' (template.spliced <order>)] - (do random.monad - [parameter (|> <generator> (random.only <only>)) - subject <generator>] - (`` (all _.and - (~~ (template [<concatenative> <functional>] - [(_.coverage [<concatenative>] - (<=> (<functional> parameter subject) - (||> (/.push subject) - (/.push parameter) - <concatenative>)))] - - <arithmetic>')) - (~~ (template [<concatenative> <functional>] - [(_.coverage [<concatenative>] - (bit#= (<functional> parameter subject) +(def: !numerical + (template (_ <=> <generator> <only> <arithmetic> <order>) + [(is Test + (with_expansions [<arithmetic>' (template.spliced <arithmetic>) + <order>' (template.spliced <order>)] + (do random.monad + [parameter (|> <generator> (random.only <only>)) + subject <generator>] + (`` (all _.and + (~~ (with_template [<concatenative> <functional>] + [(_.coverage [<concatenative>] + (<=> (<functional> parameter subject) (||> (/.push subject) (/.push parameter) <concatenative>)))] - <order>')) - )))))]) + <arithmetic>')) + (~~ (with_template [<concatenative> <functional>] + [(_.coverage [<concatenative>] + (bit#= (<functional> parameter subject) + (||> (/.push subject) + (/.push parameter) + <concatenative>)))] + + <order>')) + )))))])) (def: numerical Test diff --git a/stdlib/source/test/lux/control/function/inline.lux b/stdlib/source/test/lux/control/function/inline.lux index 54cbeabc7..6bd4eee3e 100644 --- a/stdlib/source/test/lux/control/function/inline.lux +++ b/stdlib/source/test/lux/control/function/inline.lux @@ -11,8 +11,9 @@ [\\library ["[0]" /]]) -(template: (!quadrance/2 m0 m1) - [(i.+ (i.* m0 m0) (i.* m1 m1))]) +(def: !quadrance/2 + (template (_ m0 m1) + [(i.+ (i.* m0 m0) (i.* m1 m1))])) (/.inline: .public (quadrance/2 m0 m1) (-> Int Int Int) diff --git a/stdlib/source/test/lux/control/parser/analysis.lux b/stdlib/source/test/lux/control/parser/analysis.lux index 6f79c1dcb..41b24f031 100644 --- a/stdlib/source/test/lux/control/parser/analysis.lux +++ b/stdlib/source/test/lux/control/parser/analysis.lux @@ -33,13 +33,14 @@ [\\library ["[0]" /]]) -(template: (!expect <expectation> <computation>) - [(case <computation> - <expectation> - true +(def: !expect + (template (_ <expectation> <computation>) + [(case <computation> + <expectation> + true - _ - false)]) + _ + false)])) (def: constant (Random Constant) @@ -64,7 +65,7 @@ {try.#Failure _} false)))) - (~~ (template [<query> <check> <random> <analysis> <=>] + (~~ (with_template [<query> <check> <random> <analysis> <=>] [(do [! random.monad] [expected <random>] (_.coverage [<query>] diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index f2198c2d5..7debf57b5 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -43,13 +43,14 @@ [\\library ["[0]" /]]) -(template: (!expect <expectation> <computation>) - [(case <computation> - <expectation> - true +(def: !expect + (template (_ <expectation> <computation>) + [(case <computation> + <expectation> + true - _ - false)]) + _ + false)])) (def: segment_size 10) @@ -126,7 +127,7 @@ Test (<| (_.for [/.Size]) (`` (all _.and - (~~ (template [<size> <parser> <format>] + (~~ (with_template [<size> <parser> <format>] [(do [! random.monad] [expected (at ! each (i64.and (i64.mask <size>)) random.nat)] @@ -146,7 +147,7 @@ (def: binary Test (`` (all _.and - (~~ (template [<parser> <format>] + (~~ (with_template [<parser> <format>] [(do [! random.monad] [expected (at ! each (at utf8.codec encoded) (random.ascii ..segment_size))] (_.coverage [<parser> <format>] @@ -164,7 +165,7 @@ (def: utf8 Test (`` (all _.and - (~~ (template [<parser> <format>] + (~~ (with_template [<parser> <format>] [(do [! random.monad] [expected (random.ascii ..segment_size)] (_.coverage [<parser> <format>] @@ -183,7 +184,7 @@ (def: sequence Test (`` (all _.and - (~~ (template [<parser> <format>] + (~~ (with_template [<parser> <format>] [(do [! random.monad] [expected (random.sequence ..segment_size random.nat)] (_.coverage [<parser> <format>] @@ -202,7 +203,7 @@ (def: simple Test (`` (all _.and - (~~ (template [<parser> <format> <random> <equivalence>] + (~~ (with_template [<parser> <format> <random> <equivalence>] [(do [! random.monad] [expected <random>] (_.coverage [<parser> <format>] @@ -241,7 +242,7 @@ (def: complex Test (`` (all _.and - (~~ (template [<parser> <format> <random> <equivalence>] + (~~ (with_template [<parser> <format> <random> <equivalence>] [(do [! random.monad] [expected <random>] (_.coverage [<parser> <format>] @@ -255,7 +256,7 @@ [/.code format.code random_code code.equivalence] [/.type format.type random_type type.equivalence] )) - (~~ (template [<parser_coverage> <parser> <coverage_format> <format> <random> <equivalence>] + (~~ (with_template [<parser_coverage> <parser> <coverage_format> <format> <random> <equivalence>] [(do [! random.monad] [expected <random>] (_.coverage [<parser_coverage> <coverage_format>] diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux index 9e12a51aa..686207191 100644 --- a/stdlib/source/test/lux/control/parser/cli.lux +++ b/stdlib/source/test/lux/control/parser/cli.lux @@ -20,13 +20,14 @@ [\\library ["[0]" /]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) (def: .public test Test diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index 01837874f..c0fecf490 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -28,13 +28,14 @@ [\\library ["[0]" /]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) (def: local (Random Text) @@ -67,7 +68,7 @@ (!expect {try.#Success _})) (|> (/.result /.any (list)) (!expect {try.#Failure _}))))) - (~~ (template [<query> <check> <random> <code> <equivalence>] + (~~ (with_template [<query> <check> <random> <code> <equivalence>] [(do [! random.monad] [expected <random> dummy (|> <random> (random.only (|>> (at <equivalence> = expected) not)))] @@ -94,7 +95,7 @@ [/.global /.this_global ..global code.symbol symbol.equivalence] [/.symbol /.this_symbol ..any_symbol code.symbol symbol.equivalence] )) - (~~ (template [<query> <code>] + (~~ (with_template [<query> <code>] [(do [! random.monad] [expected_left random.nat expected_right random.int] diff --git a/stdlib/source/test/lux/control/parser/json.lux b/stdlib/source/test/lux/control/parser/json.lux index 6c2a0753a..15b110eed 100644 --- a/stdlib/source/test/lux/control/parser/json.lux +++ b/stdlib/source/test/lux/control/parser/json.lux @@ -30,13 +30,14 @@ [\\library ["[0]" /]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) (def: safe_frac (Random Frac) @@ -56,7 +57,7 @@ (_.coverage [/.null] (|> (/.result /.null {json.#Null}) (!expect {try.#Success _}))) - (~~ (template [<query> <test> <check> <random> <json> <equivalence>] + (~~ (with_template [<query> <test> <check> <random> <json> <equivalence>] [(do [! random.monad] [expected <random> dummy (|> <random> (random.only (|>> (at <equivalence> = expected) not)))] diff --git a/stdlib/source/test/lux/control/parser/synthesis.lux b/stdlib/source/test/lux/control/parser/synthesis.lux index 7046d5d1d..9f765d0a5 100644 --- a/stdlib/source/test/lux/control/parser/synthesis.lux +++ b/stdlib/source/test/lux/control/parser/synthesis.lux @@ -34,13 +34,14 @@ [\\library ["[0]" /]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) (def: random_constant (Random Symbol) @@ -63,7 +64,7 @@ (def: simple Test (`` (all _.and - (~~ (template [<query> <check> <random> <synthesis> <equivalence>] + (~~ (with_template [<query> <check> <random> <synthesis> <equivalence>] [(do [! random.monad] [expected <random> dummy (|> <random> (random.only (|>> (at <equivalence> = expected) not)))] diff --git a/stdlib/source/test/lux/control/parser/text.lux b/stdlib/source/test/lux/control/parser/text.lux index 55a334421..1c8390cfc 100644 --- a/stdlib/source/test/lux/control/parser/text.lux +++ b/stdlib/source/test/lux/control/parser/text.lux @@ -32,13 +32,14 @@ ["<>" // (.only) ["<c>" code]]]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) (def: (should_fail' sample parser exception) (All (_ a e) (-> Text (/.Parser a) (Exception e) Bit)) diff --git a/stdlib/source/test/lux/control/parser/tree.lux b/stdlib/source/test/lux/control/parser/tree.lux index 91b023b6a..f10b11b26 100644 --- a/stdlib/source/test/lux/control/parser/tree.lux +++ b/stdlib/source/test/lux/control/parser/tree.lux @@ -21,35 +21,38 @@ ["[0]" / (.only) ["/[1]" //]]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) -(template: (!cover <coverage> <parser> <sample>) - [(do [! random.monad] - [dummy random.nat - expected (|> random.nat (random.only (|>> (n.= dummy) not)))] - (_.coverage <coverage> - (|> (/.result <parser> - <sample>) - (!expect (^.multi {try.#Success actual} - (n.= expected actual))))))]) +(def: !cover + (template (_ <coverage> <parser> <sample>) + [(do [! random.monad] + [dummy random.nat + expected (|> random.nat (random.only (|>> (n.= dummy) not)))] + (_.coverage <coverage> + (|> (/.result <parser> + <sample>) + (!expect (^.multi {try.#Success actual} + (n.= expected actual))))))])) -(template: (!cover/2 <coverage> <parser> <sample0> <sample1>) - [(do [! random.monad] - [dummy random.nat - expected (|> random.nat (random.only (|>> (n.= dummy) not)))] - (_.coverage <coverage> - (and (|> (/.result <parser> <sample0>) - (!expect (^.multi {try.#Success actual} - (n.= expected actual)))) - (|> (/.result <parser> <sample1>) - (!expect (^.multi {try.#Success actual} - (n.= expected actual)))))))]) +(def: !cover/2 + (template (_ <coverage> <parser> <sample0> <sample1>) + [(do [! random.monad] + [dummy random.nat + expected (|> random.nat (random.only (|>> (n.= dummy) not)))] + (_.coverage <coverage> + (and (|> (/.result <parser> <sample0>) + (!expect (^.multi {try.#Success actual} + (n.= expected actual)))) + (|> (/.result <parser> <sample1>) + (!expect (^.multi {try.#Success actual} + (n.= expected actual)))))))])) (def: .public test Test @@ -162,7 +165,7 @@ (do [! random.monad] [dummy random.nat] (_.coverage [/.cannot_move_further] - (`` (and (~~ (template [<parser>] + (`` (and (~~ (with_template [<parser>] [(|> (/.result <parser> (tree.leaf dummy)) (!expect (^.multi {try.#Failure error} diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux index 2d871bdef..e928d3903 100644 --- a/stdlib/source/test/lux/control/parser/type.lux +++ b/stdlib/source/test/lux/control/parser/type.lux @@ -25,13 +25,14 @@ ["[0]" / (.only) ["/[1]" //]]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) (def: primitive (Random Type) @@ -82,7 +83,7 @@ expected_middle ..primitive expected_right ..primitive] (`` (all _.and - (~~ (template [<parser> <exception> <good_constructor> <bad_constructor>] + (~~ (with_template [<parser> <exception> <good_constructor> <bad_constructor>] [(_.coverage [<parser> <exception>] (and (|> (/.result (<parser> (all //.and /.any /.any /.any)) (<good_constructor> (list expected_left expected_middle expected_right))) @@ -264,7 +265,7 @@ (do [! random.monad] [expected ..primitive] (_.coverage [/.empty_input] - (`` (and (~~ (template [<parser>] + (`` (and (~~ (with_template [<parser>] [(|> (/.result (do //.monad [_ /.any] <parser>) diff --git a/stdlib/source/test/lux/control/parser/xml.lux b/stdlib/source/test/lux/control/parser/xml.lux index 57833948e..818f48a14 100644 --- a/stdlib/source/test/lux/control/parser/xml.lux +++ b/stdlib/source/test/lux/control/parser/xml.lux @@ -28,25 +28,27 @@ ["[0]" / (.only) ["/[1]" // (.open: "[1]#[0]" monad)]]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> - true - - _ - false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> + true + + _ + false)])) -(template: (!failure <exception> <cases>) - [(with_expansions [<<cases>> (template.spliced <cases>)] - (do [! random.monad] - [expected (random.alphabetic 1)] - (_.coverage [<exception>] - (`` (and (~~ (template [<parser> <input>] - [(|> (/.result <parser> (list <input>)) - (!expect (^.multi {try.#Failure error} - (exception.match? <exception> error))))] +(def: !failure + (template (_ <exception> <cases>) + [(with_expansions [<<cases>> (template.spliced <cases>)] + (do [! random.monad] + [expected (random.alphabetic 1)] + (_.coverage [<exception>] + (`` (and (~~ (with_template [<parser> <input>] + [(|> (/.result <parser> (list <input>)) + (!expect (^.multi {try.#Failure error} + (exception.match? <exception> error))))] - <<cases>>)))))))]) + <<cases>>)))))))])) (def: random_label (Random Symbol) diff --git a/stdlib/source/test/lux/data.lux b/stdlib/source/test/lux/data.lux index 25b679962..30ffac578 100644 --- a/stdlib/source/test/lux/data.lux +++ b/stdlib/source/test/lux/data.lux @@ -23,11 +23,12 @@ ["[1][0]" collection]]) ... TODO: Get rid of this ASAP -(template: (!bundle body) - [(is Test - (do random.monad - [_ (in [])] - body))]) +(def: !bundle + (template (_ body) + [(is Test + (do random.monad + [_ (in [])] + body))])) (def: format Test diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index b0eea56fa..dd5949cab 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -100,7 +100,7 @@ (!.= (!.empty size) (!.empty size))) (_.coverage [!.size] (|> (!.empty size) !.size (n.= size))) - (~~ (template [<power> <bytes/?> <has/?>] + (~~ (with_template [<power> <bytes/?> <has/?>] [(_.coverage [<bytes/?> <has/?>] (let [bytes (i64.left_shifted <power> 1) binary (!.empty bytes) diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index 3e05ec3f4..f82ac2f35 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -246,7 +246,7 @@ (_.coverage [/.member?] (/.every? (/.member? n.equivalence sample) sample)) - (~~ (template [<head> <tail> <pre>] + (~~ (with_template [<head> <tail> <pre>] [(all _.and (_.coverage [<head>] (case [(<pre> sample) (<head> sample)] diff --git a/stdlib/source/test/lux/data/collection/set/multi.lux b/stdlib/source/test/lux/data/collection/set/multi.lux index 8e68d0a63..0cabf93c6 100644 --- a/stdlib/source/test/lux/data/collection/set/multi.lux +++ b/stdlib/source/test/lux/data/collection/set/multi.lux @@ -57,7 +57,7 @@ sample (..random diversity n.hash ..count random.nat) another (..random diversity n.hash ..count random.nat)] (`` (all _.and - (~~ (template [<name> <composition>] + (~~ (with_template [<name> <composition>] [(_.coverage [<name>] (let [|sample| (/.support sample) |another| (/.support another) diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index d35037fd9..95f1644a1 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -71,7 +71,7 @@ (|> setL /.list (/.of_list n.order) (/#= setL))) - (~~ (template [<coverage> <comparison>] + (~~ (with_template [<coverage> <comparison>] [(_.coverage [<coverage>] (case (<coverage> setL) {.#Some value} @@ -123,7 +123,7 @@ (and self! empty! symmetry!))) - (~~ (template [<coverage> <relation> <empty?>] + (~~ (with_template [<coverage> <relation> <empty?>] [(_.coverage [<coverage>] (let [self! (at /.equivalence = diff --git a/stdlib/source/test/lux/data/color.lux b/stdlib/source/test/lux/data/color.lux index 9f2534c83..e1d06c542 100644 --- a/stdlib/source/test/lux/data/color.lux +++ b/stdlib/source/test/lux/data/color.lux @@ -56,7 +56,7 @@ (def: rgb_error_margin +1.8) -(template [<field>] +(with_template [<field>] [(def: (<field> color) (-> /.Color Frac) (let [[hue saturation luminance] (/.hsl color)] @@ -140,7 +140,7 @@ spread (at ! each (|>> f.abs (f.% spread_space) (f.+ min_spread)) random.safe_frac)] (`` (all _.and - (~~ (template [<brightness> <palette>] + (~~ (with_template [<brightness> <palette>] [(_.coverage [<palette>] (let [eB <brightness> expected (/.of_hsb [eH eS eB]) @@ -150,7 +150,7 @@ [+1.0 /.analogous] [+0.5 /.monochromatic] )) - (~~ (template [<palette>] + (~~ (with_template [<palette>] [(_.coverage [<palette>] (let [expected (/.of_hsb [eH eS +0.5]) [c0 c1 c2] (<palette> expected)] @@ -161,7 +161,7 @@ [/.triad] [/.clash] [/.split_complement])) - (~~ (template [<palette>] + (~~ (with_template [<palette>] [(_.coverage [<palette>] (let [expected (/.of_hsb [eH eS +0.5]) [c0 c1 c2 c3] (<palette> expected)] diff --git a/stdlib/source/test/lux/data/color/named.lux b/stdlib/source/test/lux/data/color/named.lux index ce902b16b..7034f41d1 100644 --- a/stdlib/source/test/lux/data/color/named.lux +++ b/stdlib/source/test/lux/data/color/named.lux @@ -201,7 +201,7 @@ /.yellow_green]] )] (def: all_colors - (list.together (`` (list (~~ (template [<definition> <by_letter>] + (list.together (`` (list (~~ (with_template [<definition> <by_letter>] [((is (-> Any (List //.Color)) (function (_ _) (`` (list (~~ (template.spliced <by_letter>)))))) @@ -216,7 +216,7 @@ (n.= (list.size ..all_colors) (set.size ..unique_colors))) - (template [<definition> <by_letter>] + (with_template [<definition> <by_letter>] [(def: <definition> Test (_.coverage <by_letter> @@ -228,7 +228,7 @@ Test (<| (_.covering /._) (`` (all _.and - (~~ (template [<definition> <by_letter>] + (~~ (with_template [<definition> <by_letter>] [<definition>] <colors>)) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index a4874021b..394c9f1c1 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -137,7 +137,7 @@ true)]] (in (and can_find_known_key! cannot_find_unknown_key!)))))) - (~~ (template [<type> <field> <tag> <random> <equivalence>] + (~~ (with_template [<type> <field> <tag> <random> <equivalence>] [(do random.monad [key (random.alphabetic 1) value <random>] @@ -169,7 +169,7 @@ <key6> (string)] (_.coverage [/.json] (and (/#= {/.#Null} (/.json ())) - (~~ (template [<tag> <value>] + (~~ (with_template [<tag> <value>] [(/#= {<tag> <value>} (/.json <value>))] [/.#Boolean <boolean>] diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 4681f3822..33487622a 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -167,7 +167,7 @@ text.together (at utf8.codec encoded))]] (`` (all _.and - (~~ (template [<type> <tag>] + (~~ (with_template [<type> <tag>] [(_.coverage [<type>] (|> (do try.monad [expected_path (/.path expected_path) @@ -188,7 +188,7 @@ )) (_.for [/.File /.Content /.content /.data] (all _.and - (~~ (template [<type> <tag>] + (~~ (with_template [<type> <tag>] [(_.coverage [<type>] (|> (do try.monad [expected_path (/.path expected_path) @@ -269,7 +269,7 @@ _ false))) (try.else false))) - (~~ (template [<expected_mode>] + (~~ (with_template [<expected_mode>] [(_.coverage [<expected_mode>] (|> (do try.monad [path (/.path path) diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux index fffae6ba2..d792a8f87 100644 --- a/stdlib/source/test/lux/data/format/xml.lux +++ b/stdlib/source/test/lux/data/format/xml.lux @@ -81,7 +81,7 @@ (do [! random.monad] [(^.let symbol [namespace name]) ..symbol] (`` (all _.and - (~~ (template [<type> <format>] + (~~ (with_template [<type> <format>] [(_.coverage [<type> <format>] (and (text#= name (<format> ["" name])) (let [symbol (<format> symbol)] diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index 3e1889c04..ebda04668 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -59,7 +59,7 @@ .let [full (at /.monoid composite inner outer) fake_index (-- 0)]] (`` (all _.and - (~~ (template [<affix> <predicate>] + (~~ (with_template [<affix> <predicate>] [(_.coverage [<affix> <predicate>] (<predicate> outer (<affix> outer inner)))] @@ -129,7 +129,7 @@ (all _.and (_.for [/.Char /.of_char] (`` (all _.and - (~~ (template [<short> <long>] + (~~ (with_template [<short> <long>] [(_.coverage [<short> <long>] (at /.equivalence = <short> <long>))] @@ -163,7 +163,7 @@ {.#None} false))) (_.coverage [/.space /.space?] - (`` (and (~~ (template [<char>] + (`` (and (~~ (with_template [<char>] [(/.space? (`` (.char (~~ (static <char>)))))] [/.tab] diff --git a/stdlib/source/test/lux/data/text/encoding.lux b/stdlib/source/test/lux/data/text/encoding.lux index 4e30d8797..12be514b8 100644 --- a/stdlib/source/test/lux/data/text/encoding.lux +++ b/stdlib/source/test/lux/data/text/encoding.lux @@ -182,7 +182,7 @@ /.koi8_r /.koi8_u]] ) - <named> (template [<definition> <by_letter>] + <named> (with_template [<definition> <by_letter>] [((is (-> Any (List /.Encoding)) (function (_ _) (`` (list (~~ (template.spliced <by_letter>)))))) @@ -202,7 +202,7 @@ (n.= (list.size ..all_encodings) (set.size ..unique_encodings))) - (template [<definition> <by_letter>] + (with_template [<definition> <by_letter>] [(def: <definition> Test (`` (_.coverage [/.name (~~ (template.spliced <by_letter>))] @@ -222,7 +222,7 @@ (<| (_.covering /._) (_.for [/.Encoding]) (`` (all _.and - (~~ (template [<definition> <by_letter>] + (~~ (with_template [<definition> <by_letter>] [<definition>] <encodings>)) diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 8a897d348..c6c961dfe 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -89,7 +89,7 @@ (do random.monad [ascii ..ascii_range] (_.coverage [/.escapable?] - (`` (if (or (~~ (template [<char>] + (`` (if (or (~~ (with_template [<char>] [(n.= (debug.private <char>) ascii)] [/.\0] [/.\a] [/.\b] [/.\t] diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index 13446a8ce..20c8ea453 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -73,7 +73,7 @@ (def: codec Test (`` (all _.and - (~~ (template [<format> <codec> <random>] + (~~ (with_template [<format> <codec> <random>] [(do random.monad [sample <random>] (_.coverage [<format>] @@ -139,7 +139,7 @@ (text#= (/.format left mid right) (all "lux text concat" left mid right)))) ..codec - (~~ (template [<format> <alias> <random>] + (~~ (with_template [<format> <alias> <random>] [(do random.monad [sample <random>] (_.coverage [<format>] diff --git a/stdlib/source/test/lux/data/text/unicode/block.lux b/stdlib/source/test/lux/data/text/unicode/block.lux index 00e98bf4d..c07da3b71 100644 --- a/stdlib/source/test/lux/data/text/unicode/block.lux +++ b/stdlib/source/test/lux/data/text/unicode/block.lux @@ -146,14 +146,14 @@ /.upper_case /.lower_case]] ) - <named> (template [<definition> <part>] + <named> (with_template [<definition> <part>] [((is (-> Any (List /.Block)) (function (_ _) (`` (list (~~ (template.spliced <part>)))))) [])] <blocks>)] - (template [<definition> <part>] + (with_template [<definition> <part>] [(def: <definition> Test (`` (_.coverage [(~~ (template.spliced <part>))] @@ -205,7 +205,7 @@ (and (/.within? sample inside) (not (/.within? sample (-- (/.start sample)))) (not (/.within? sample (++ (/.end sample)))))) - (~~ (template [<definition> <part>] + (~~ (with_template [<definition> <part>] [<definition>] <blocks>)))) diff --git a/stdlib/source/test/lux/data/text/unicode/set.lux b/stdlib/source/test/lux/data/text/unicode/set.lux index f2c9808c0..e4eed7710 100644 --- a/stdlib/source/test/lux/data/text/unicode/set.lux +++ b/stdlib/source/test/lux/data/text/unicode/set.lux @@ -73,7 +73,7 @@ (n.= (n.max (block.end left) (block.end right)) (/.end composed))))) - (~~ (template [<set>] + (~~ (with_template [<set>] [(do random.monad [char (random.char <set>) .let [start (/.start <set>) diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux index bfa275ce7..1d88519e0 100644 --- a/stdlib/source/test/lux/debug.lux +++ b/stdlib/source/test/lux/debug.lux @@ -57,7 +57,7 @@ sample_text (random.upper_case 10) sample_nat random.nat sample_rev random.rev] - (in (`` (and (~~ (template [<type> <format> <sample>] + (in (`` (and (~~ (with_template [<type> <format> <sample>] [(|> (/.representation <type> <sample>) (try#each (text#= (<format> <sample>))) (try.else false))] @@ -88,7 +88,7 @@ {try.#Failure error} false) ... TODO: Uncomment after switching from the old (tag+last?) to the new (lefts+right?) representation for variants - ... (~~ (template [<lefts> <right?> <value> <format>] + ... (~~ (with_template [<lefts> <right?> <value> <format>] ... [(|> (/.representation (type (Or Bit Int Frac)) ... (is (Or Bit Int Frac) ... (<lefts> <right?> <value>))) @@ -113,7 +113,7 @@ sample_code $//code.random sample_xml $//xml.random sample_json $//json.random] - (in (`` (and (~~ (template [<type> <format> <sample>] + (in (`` (and (~~ (with_template [<type> <format> <sample>] [(|> (/.representation <type> <sample>) (try#each (text#= (<format> <sample>))) (try.else false))] @@ -136,7 +136,7 @@ sample_month random.month sample_time random.time sample_day random.day] - (in (`` (and (~~ (template [<type> <format> <sample>] + (in (`` (and (~~ (with_template [<type> <format> <sample>] [(|> (/.representation <type> <sample>) (try#each (text#= (<format> <sample>))) (try.else false))] @@ -174,7 +174,7 @@ (|> (/.representation (type (List Nat)) (is (List Nat) (list sample_nat))) (try#each (text#= (%.list %.nat (list sample_nat)))) (try.else false)) - (~~ (template [<sample>] + (~~ (with_template [<sample>] [(|> (/.representation (type (Maybe Nat)) (is (Maybe Nat) <sample>)) (try#each (text#= (%.maybe %.nat <sample>))) (try.else false))] @@ -200,7 +200,7 @@ sample_frac random.frac sample_text (random.upper_case 10)] (_.coverage [/.inspection] - (`` (and (~~ (template [<format> <sample>] + (`` (and (~~ (with_template [<format> <sample>] [(text#= (<format> <sample>) (/.inspection <sample>))] [%.bit sample_bit] diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index 3052034b4..5d74472a2 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -107,7 +107,7 @@ false)))) )) (_.coverage [/.unqualified_symbol] - (`` (and (~~ (template [<example>] + (`` (and (~~ (with_template [<example>] [(macro_error <example>)] [(/.default g!default)] diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index 9079d5336..0716e76d1 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -64,7 +64,7 @@ (def: dummy_generation "dummy generation") -(template [<name>] +(with_template [<name>] [(def: <name> Text (`` (%.symbol (symbol (~~ (template.symbol [.._ <name>]))))))] @@ -187,7 +187,7 @@ (do random.monad [expected random.nat] (`` (all _.and - (~~ (template [<macro> <extension>] + (~~ (with_template [<macro> <extension>] [(_.coverage [<macro>] (for @.old false (n.= expected diff --git a/stdlib/source/test/lux/ffi.js.lux b/stdlib/source/test/lux/ffi.js.lux index ade4d78a8..6de496499 100644 --- a/stdlib/source/test/lux/ffi.js.lux +++ b/stdlib/source/test/lux/ffi.js.lux @@ -59,7 +59,7 @@ object random.nat] (<| (_.covering /._) (`` (all _.and - (~~ (template [<type> <value>] + (~~ (with_template [<type> <value>] [(_.coverage [<type>] (exec (is <type> <value>) @@ -71,7 +71,7 @@ )) (_.for [/.Object] (all _.and - (~~ (template [<type>] + (~~ (with_template [<type>] [(_.coverage [<type>] (exec (is (Ex (_ a) (/.Object a)) diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 3a6df69db..1b96680d3 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -55,7 +55,7 @@ "[1]::[0]" (getName [] java/lang/String)) -(template [<name> <type> <conversion> <lux> <=>] +(with_template [<name> <type> <conversion> <lux> <=>] [(def: (<name> left right) (-> <type> <type> Bit) (<=> (as <lux> (<conversion> left)) @@ -94,7 +94,7 @@ (random.only (|>> f.not_a_number? not)) (at ! each (|>> /.as_float)))] (`` (all _.and - (~~ (template [<sample> <=> <to> <from>] + (~~ (with_template [<sample> <=> <to> <from>] [(_.coverage [<to> <from>] (or (|> <sample> <to> <from> (<=> <sample>)) (let [capped (|> <sample> <to> <from>)] @@ -197,7 +197,7 @@ /.!!! /.null? not))) - (~~ (template [<object> <primitive> <jvm#value> <jvm#=> + (~~ (with_template [<object> <primitive> <jvm#value> <jvm#=> <lux#value> <as> <of> <lux#=>] [(_.coverage [<object> <primitive>] (|> <jvm#value> diff --git a/stdlib/source/test/lux/ffi.lua.lux b/stdlib/source/test/lux/ffi.lua.lux index cd80999b8..4ca013d88 100644 --- a/stdlib/source/test/lux/ffi.lua.lux +++ b/stdlib/source/test/lux/ffi.lua.lux @@ -24,7 +24,7 @@ string (random.lower_case 1)] (<| (_.covering /._) (`` (all _.and - (~~ (template [<type> <sample>] + (~~ (with_template [<type> <sample>] [(_.coverage [<type>] (exec (is <type> <sample>) @@ -37,7 +37,7 @@ )) (_.for [/.Object] (all _.and - (~~ (template [<type>] + (~~ (with_template [<type>] [(_.coverage [<type>] (exec (|> [] diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index 021af2ad4..3c00f11c5 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -100,7 +100,7 @@ (random.only (|>> f.not_a_number? not)) (at ! each (|>> /.double_to_float)))] (`` (all _.and - (~~ (template [<=> <sample> <to> <from>] + (~~ (with_template [<=> <sample> <to> <from>] [(_.coverage [<to> <from>] (or (|> <sample> <to> <from> (<=> <sample>)) (let [capped (|> <sample> <to> <from>)] @@ -115,7 +115,7 @@ [f.= double /.double_to_float /.float_to_double] [f.= double /.double_to_int /.int_to_double] )) - (~~ (template [<to> <from>] + (~~ (with_template [<to> <from>] [(_.coverage [<to>] (or (|> int <to> <from> (i.= (/.int_to_long int))) (let [capped (|> int <to> <from>)] @@ -125,7 +125,7 @@ [/.int_to_short /.short_to_long] [/.int_to_char /.char_to_long] )) - (~~ (template [<sample> <to> <from>] + (~~ (with_template [<sample> <to> <from>] [(_.coverage [<to> <from>] (or (|> <sample> <to> <from> /.float_to_double (f.= (/.float_to_double <sample>))) (let [capped (|> <sample> <to> <from>)] @@ -133,7 +133,7 @@ [float /.float_to_int /.int_to_float] )) - (~~ (template [<to> <from>] + (~~ (with_template [<to> <from>] [(_.coverage [<to>] (or (|> char <to> <from> (i.= (|> char /.char_to_int /.int_to_long))) (let [capped (|> char <to> <from>)] diff --git a/stdlib/source/test/lux/ffi.py.lux b/stdlib/source/test/lux/ffi.py.lux index 98d68142f..bdaab94c5 100644 --- a/stdlib/source/test/lux/ffi.py.lux +++ b/stdlib/source/test/lux/ffi.py.lux @@ -27,7 +27,7 @@ string (random.lower_case 1)] (<| (_.covering /._) (`` (all _.and - (~~ (template [<type> <sample>] + (~~ (with_template [<type> <sample>] [(_.coverage [<type>] (exec (is <type> <sample>) @@ -40,7 +40,7 @@ )) (_.for [/.Object] (all _.and - (~~ (template [<type>] + (~~ (with_template [<type>] [(_.coverage [<type>] (exec (|> [] diff --git a/stdlib/source/test/lux/ffi.rb.lux b/stdlib/source/test/lux/ffi.rb.lux index 268512134..f5185ea81 100644 --- a/stdlib/source/test/lux/ffi.rb.lux +++ b/stdlib/source/test/lux/ffi.rb.lux @@ -24,7 +24,7 @@ string (random.lower_case 1)] (<| (_.covering /._) (`` (all _.and - (~~ (template [<type> <sample>] + (~~ (with_template [<type> <sample>] [(_.coverage [<type>] (exec (is <type> <sample>) @@ -37,7 +37,7 @@ )) (_.for [/.Object] (all _.and - (~~ (template [<type>] + (~~ (with_template [<type>] [(_.coverage [<type>] (exec (|> [] diff --git a/stdlib/source/test/lux/ffi/export.jvm.lux b/stdlib/source/test/lux/ffi/export.jvm.lux index 3ad692d50..d79489e9b 100644 --- a/stdlib/source/test/lux/ffi/export.jvm.lux +++ b/stdlib/source/test/lux/ffi/export.jvm.lux @@ -46,7 +46,7 @@ (actual_double double ..expected_double) ... Methods - (~~ (template [<type> <+>] + (~~ (with_template [<type> <+>] [(((~~ (template.symbol [<type> "_method"])) [left <type> right <type>]) @@ -77,7 +77,7 @@ ("static" actual_float float) ("static" actual_double double) - (~~ (template [<type>] + (~~ (with_template [<type>] [("static" (~~ (template.symbol [<type> "_method"])) [<type> <type>] <type>)] [boolean] @@ -126,7 +126,7 @@ Test (<| (_.covering /._) (do [! random.monad] - [(~~ (template [<type> <as> <random>] + [(~~ (with_template [<type> <as> <random>] [(~~ (template.symbol [left_ <type>])) (at ! each (|>> <as>) <random>) (~~ (template.symbol [right_ <type>])) (at ! each (|>> <as>) <random>)] @@ -151,7 +151,7 @@ (frac#= (//.of_float ..expected_float) (//.of_float (Primitives::actual_float))) (frac#= (//.of_double ..expected_double) (//.of_double (Primitives::actual_double))) - (~~ (template [<=> <+> <type>] + (~~ (with_template [<=> <+> <type>] [(with_expansions [<left> (template.symbol ["left_" <type>]) <right> (template.symbol ["right_" <type>]) <of> (template.symbol [//._] ["of_" <type>]) diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux index cb2fb5477..8691b1dc4 100644 --- a/stdlib/source/test/lux/locale/language.lux +++ b/stdlib/source/test/lux/locale/language.lux @@ -31,7 +31,7 @@ #languages (Set /.Language) #test Test])) -(template [<bundle> <languages>] +(with_template [<bundle> <languages>] [(def: <bundle> Bundle (let [amount (template.amount <languages>) @@ -202,7 +202,7 @@ (list#each (the #test)) (list#mix _.and (`` (all _.and - (~~ (template [<lens> <tag> <hash>] + (~~ (with_template [<lens> <tag> <hash>] [(let [[amount set] (..aggregate (the <tag>) <hash> ..languages)] (_.coverage [<lens>] (n.= amount (set.size set))))] @@ -213,10 +213,11 @@ )) ))))) -(template: (!aliases <reference> <aliases>) - [(_.coverage <aliases> - (list.every? (at /.equivalence = <reference>) - (`` (list (~~ (template.spliced <aliases>))))))]) +(def: !aliases + (template (_ <reference> <aliases>) + [(_.coverage <aliases> + (list.every? (at /.equivalence = <reference>) + (`` (list (~~ (template.spliced <aliases>))))))])) (def: aliases_test/0 Test diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux index 6a8051f66..a68eaf8f3 100644 --- a/stdlib/source/test/lux/locale/territory.lux +++ b/stdlib/source/test/lux/locale/territory.lux @@ -33,7 +33,7 @@ #territories (Set /.Territory) #test Test])) -(template [<bundle> <territories>] +(with_template [<bundle> <territories>] [(def: <bundle> Bundle (let [amount (template.amount <territories>) @@ -157,7 +157,7 @@ (list#each (the #test)) (list#mix _.and (`` (all _.and - (~~ (template [<lens> <tag> <hash>] + (~~ (with_template [<lens> <tag> <hash>] [(let [[amount set] (..aggregate (the <tag>) <hash> ..territories)] (_.coverage [<lens>] (n.= amount (set.size set))))] @@ -170,10 +170,11 @@ )) ))))) -(template: (!aliases <reference> <aliases>) - [(_.coverage <aliases> - (list.every? (at /.equivalence = <reference>) - (`` (list (~~ (template.spliced <aliases>))))))]) +(def: !aliases + (template (_ <reference> <aliases>) + [(_.coverage <aliases> + (list.every? (at /.equivalence = <reference>) + (`` (list (~~ (template.spliced <aliases>))))))])) (def: aliases_test Test diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux index 349ec7bbd..0a16b1491 100644 --- a/stdlib/source/test/lux/macro.lux +++ b/stdlib/source/test/lux/macro.lux @@ -36,14 +36,16 @@ ["[1][0]" template] ["[1][0]" pattern]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> true - _ false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> true + _ false)])) -(template: (!global <definition>) - [(is [Text .Global] - [(template.text [<definition>]) {.#Definition [true .Macro <definition>]}])]) +(def: !global + (template (_ <definition>) + [(is [Text .Global] + [(template.text [<definition>]) {.#Definition [true .Macro <definition>]}])])) (def: pow/2 (syntax (_ [number <code>.any]) @@ -130,7 +132,7 @@ full_expansion (` (n.* (n.* (~ pow/1) (~ pow/1)) (n.* (~ pow/1) (~ pow/1))))]] (`` (all _.and - (~~ (template [<expander> <logger> <expansion>] + (~~ (with_template [<expander> <logger> <expansion>] [(_.coverage [<expander>] (|> (<expander> (` (..pow/4 (~ pow/1)))) (meta.result lux) diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux index f01a61c3f..b0479c538 100644 --- a/stdlib/source/test/lux/macro/code.lux +++ b/stdlib/source/test/lux/macro/code.lux @@ -104,7 +104,7 @@ (def: for_format Test (`` (all _.and - (~~ (template [<coverage> <random> <tag>] + (~~ (with_template [<coverage> <random> <tag>] [(do [! random.monad] [expected <random>] (_.coverage [<coverage>] @@ -130,7 +130,7 @@ [/.form (..random_sequence ..random) .#Form] [/.variant (..random_sequence ..random) .#Variant] [/.tuple (..random_sequence ..random) .#Tuple])) - (~~ (template [<coverage> <random> <tag>] + (~~ (with_template [<coverage> <random> <tag>] [(do [! random.monad] [expected <random>] (_.coverage [<coverage>] diff --git a/stdlib/source/test/lux/macro/pattern.lux b/stdlib/source/test/lux/macro/pattern.lux index 277d02830..53d3435ce 100644 --- a/stdlib/source/test/lux/macro/pattern.lux +++ b/stdlib/source/test/lux/macro/pattern.lux @@ -22,9 +22,10 @@ [#left l #right r])) -(template: (!pair <left> <right>) - [[..#left <left> - ..#right <right>]]) +(def: !pair + (template (_ <left> <right>) + [[..#left <left> + ..#right <right>]])) (def: .public test Test @@ -41,9 +42,9 @@ (all _.and (do [! random.monad] [sample (at ! each (n.% 5) random.nat)] - (_.coverage [/.template] + (_.coverage [/.with_template] (case sample - (/.template [<case>] + (/.with_template [<case>] [<case> true]) ([0] [1] [2] [3] [4]) diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux index 38c704927..3695f4be8 100644 --- a/stdlib/source/test/lux/math.lux +++ b/stdlib/source/test/lux/math.lux @@ -58,10 +58,10 @@ parameterC (random.only (|>> (complex.= complex/0) not) random.complex) subjectC random.complex]) (`` (all _.and - (~~ (template [</> <scenarios>'] + (~~ (with_template [</> <scenarios>'] [(_.coverage [</>] (with_expansions [<scenarios> (template.spliced <scenarios>')] - (`` (and (~~ (template [<=> <//> <parameter> <subject>] + (`` (and (~~ (with_template [<=> <//> <parameter> <subject>] [(<=> (<//> <parameter> <subject>) (</> <parameter> <subject>))] @@ -98,10 +98,10 @@ [ratio.= ratio.% parameter/ subject/] [complex.= complex.% parameterC subjectC]]] )) - (~~ (template [</> <scenarios>'] + (~~ (with_template [</> <scenarios>'] [(_.coverage [</>] (with_expansions [<scenarios> (template.spliced <scenarios>')] - (`` (and (~~ (template [<//> <parameter> <subject>] + (`` (and (~~ (with_template [<//> <parameter> <subject>] [(bit#= (<//> <parameter> <subject>) (</> <parameter> <subject>))] diff --git a/stdlib/source/test/lux/math/logic/continuous.lux b/stdlib/source/test/lux/math/logic/continuous.lux index af3727efd..b4c4614e5 100644 --- a/stdlib/source/test/lux/math/logic/continuous.lux +++ b/stdlib/source/test/lux/math/logic/continuous.lux @@ -21,7 +21,7 @@ mid random.rev right random.rev] (`` (all _.and - (~~ (template [<monoid>] + (~~ (with_template [<monoid>] [(_.for [<monoid>] ($monoid.spec r.= <monoid> random.rev))] diff --git a/stdlib/source/test/lux/math/modular.lux b/stdlib/source/test/lux/math/modular.lux index aaf670ba2..76098ff66 100644 --- a/stdlib/source/test/lux/math/modular.lux +++ b/stdlib/source/test/lux/math/modular.lux @@ -52,7 +52,7 @@ ($equivalence.spec /.equivalence (..random subject::%))) (_.for [/.order /.<] ($order.spec /.order (..random subject::%))) - (~~ (template [<composite> <monoid>] + (~~ (with_template [<composite> <monoid>] [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence (<monoid> subject::%) (..random subject::%)))] diff --git a/stdlib/source/test/lux/math/number.lux b/stdlib/source/test/lux/math/number.lux index eaa74ac25..9d8b8ce52 100644 --- a/stdlib/source/test/lux/math/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -33,7 +33,7 @@ (<| (_.covering /._) (all _.and (_.coverage [/.bin] - (`` (and (~~ (template [<=> <codec> <number>] + (`` (and (~~ (with_template [<=> <codec> <number>] [(case (at <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.bin <number>) actual) @@ -52,7 +52,7 @@ [f.= f.binary "-11,00.10,01"] ))))) (_.coverage [/.oct] - (`` (and (~~ (template [<=> <codec> <number>] + (`` (and (~~ (with_template [<=> <codec> <number>] [(case (at <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.oct <number>) actual) @@ -71,7 +71,7 @@ [f.= f.octal "-61,52.43"] ))))) (_.coverage [/.hex] - (`` (and (~~ (template [<=> <codec> <number>] + (`` (and (~~ (with_template [<=> <codec> <number>] [(case (at <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.hex <number>) actual) diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index d06a60251..88862c47f 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -102,7 +102,7 @@ ($hash.spec /.hash random.frac)) (_.for [/.order /.<] ($order.spec /.order random.safe_frac)) - (~~ (template [<composite> <monoid>] + (~~ (with_template [<composite> <monoid>] [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> ..random))] @@ -112,7 +112,7 @@ [/.min /.minimum] [/.max /.maximum] )) - (~~ (template [<codec>] + (~~ (with_template [<codec>] [(_.for [<codec>] ($codec.spec /.equivalence <codec> random.safe_frac))] diff --git a/stdlib/source/test/lux/math/number/int.lux b/stdlib/source/test/lux/math/number/int.lux index 76ed060da..8f451d37e 100644 --- a/stdlib/source/test/lux/math/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -36,7 +36,7 @@ ($enum.spec /.enum random.int)) (_.for [/.interval] ($interval.spec /.interval random.int)) - (~~ (template [<monoid>] + (~~ (with_template [<monoid>] [(_.for [<monoid>] ($monoid.spec /.equivalence <monoid> random.int))] @@ -46,7 +46,7 @@ [/.minimum] [/.maximum] )) - (~~ (template [<codec>] + (~~ (with_template [<codec>] [(_.for [<codec>] ($codec.spec /.equivalence <codec> random.int))] diff --git a/stdlib/source/test/lux/math/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux index 54471e9b3..a29ce19a3 100644 --- a/stdlib/source/test/lux/math/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -34,7 +34,7 @@ ($enum.spec /.enum random.nat)) (_.for [/.interval] ($interval.spec /.interval random.nat)) - (~~ (template [<composite> <monoid>] + (~~ (with_template [<composite> <monoid>] [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> random.nat))] @@ -44,7 +44,7 @@ [/.min /.minimum] [/.max /.maximum] )) - (~~ (template [<codec>] + (~~ (with_template [<codec>] [(_.for [<codec>] ($codec.spec /.equivalence <codec> random.nat))] diff --git a/stdlib/source/test/lux/math/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux index 7b8d252ef..536ce838c 100644 --- a/stdlib/source/test/lux/math/number/ratio.lux +++ b/stdlib/source/test/lux/math/number/ratio.lux @@ -43,7 +43,7 @@ ($equivalence.spec /.equivalence ..random)) (_.for [/.order /.<] ($order.spec /.order ..random)) - (~~ (template [<composite> <monoid>] + (~~ (with_template [<composite> <monoid>] [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> ..random))] diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index 72d03d335..b7403a4f2 100644 --- a/stdlib/source/test/lux/math/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -36,7 +36,7 @@ ($enum.spec /.enum random.rev)) (_.for [/.interval] ($interval.spec /.interval random.rev)) - (~~ (template [<composite> <monoid>] + (~~ (with_template [<composite> <monoid>] [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> random.rev))] @@ -45,7 +45,7 @@ [/.min /.minimum] [/.max /.maximum] )) - (~~ (template [<codec>] + (~~ (with_template [<codec>] [(_.for [<codec>] ($codec.spec /.equivalence <codec> random.rev))] @@ -58,7 +58,7 @@ (<| (_.covering /._) (_.for [.Rev]) (`` (all _.and - (~~ (template [<half> <whole>] + (~~ (with_template [<half> <whole>] [(_.coverage [<half>] (/.= <whole> (/.+ <half> <half>)))] diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index c4f1f334c..807e0b3e0 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -38,10 +38,11 @@ ["[1][0]" configuration] ["[1][0]" version]]) -(template: (!expect <pattern> <value>) - [(case <value> - <pattern> true - _ false)]) +(def: !expect + (template (_ <pattern> <value>) + [(case <value> + <pattern> true + _ false)])) (def: compiler_related Test diff --git a/stdlib/source/test/lux/static.lux b/stdlib/source/test/lux/static.lux index 2e810c517..016fccd9e 100644 --- a/stdlib/source/test/lux/static.lux +++ b/stdlib/source/test/lux/static.lux @@ -27,7 +27,7 @@ (for @.old (_.property "PLACEHOLDER" true)) (_.for [meta.eval]) (`` (all _.and - (~~ (template [<static> <random> <=> <+> <tag>] + (~~ (with_template [<static> <random> <=> <+> <tag>] [(_.coverage [<static> <random>] (with_expansions [<left> (<random>) <right> (<random>) diff --git a/stdlib/source/test/lux/target/js.lux b/stdlib/source/test/lux/target/js.lux index 3bdd3ce1d..bff4822e6 100644 --- a/stdlib/source/test/lux/target/js.lux +++ b/stdlib/source/test/lux/target/js.lux @@ -47,7 +47,7 @@ (maybe.else false))) (try.else false))) -(template [<range>] +(with_template [<range>] [(`` (def: (~~ (template.symbol ["as_int_" <range>])) (-> Int Int) (|>> (i64.and (static.nat (-- (i64.left_shifted <range> 1))))))) @@ -102,7 +102,7 @@ [left random.bit right random.bit] (`` (all _.and - (~~ (template [<js> <lux>] + (~~ (with_template [<js> <lux>] [(_.coverage [<js>] (let [expected (<lux> left right)] (expression (|>> (as Bit) (bit#= expected)) @@ -123,7 +123,7 @@ random.safe_frac) subject random.safe_frac] (`` (all _.and - (~~ (template [<js> <lux>] + (~~ (with_template [<js> <lux>] [(_.coverage [<js>] (let [expected (<lux> parameter subject)] (expression (|>> (as Frac) (f.= expected)) @@ -135,7 +135,7 @@ [/./ f./] [/.% f.%] )) - (~~ (template [<js> <lux>] + (~~ (with_template [<js> <lux>] [(_.coverage [<js>] (let [expected (<lux> parameter subject)] (expression (|>> (as Bit) (bit#= expected)) @@ -159,7 +159,7 @@ i16 ..int_16 shift (at ! each (n.% 16) random.nat)] (`` (all _.and - (~~ (template [<js> <lux>] + (~~ (with_template [<js> <lux>] [(_.coverage [<js>] (let [expected (<lux> left right)] (expression (|>> (as Frac) f.int (i.= expected)) @@ -411,7 +411,7 @@ (list (/.number number/0))))) )) (_.coverage [/.Access] - (`` (and (~~ (template [<js> <lux>] + (`` (and (~~ (with_template [<js> <lux>] [(expression (|>> (as Frac) f.int (i.= (<lux> int/0))) (/.apply (/.closure (list $foreign) (all /.then @@ -781,7 +781,7 @@ (/.statement (/.+ $arg/0 $arg/0)) (/.return $arg/0))) (/.number number/0)))) - (~~ (template [<js> <lux>] + (~~ (with_template [<js> <lux>] [(_.coverage [<js>] (expression (|>> (as Frac) f.int (i.= (<lux> int))) (/.apply_1 (/.closure (list $arg/0) diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 974394c30..94b88c41f 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -319,7 +319,7 @@ #random ..$String::random #literal ..$String::literal]) -(template [<name> <bits> <type> <push> <wrap> <message> <to_long> <signed>] +(with_template [<name> <bits> <type> <push> <wrap> <message> <to_long> <signed>] [(def: <name> Test (do [! random.monad] @@ -338,17 +338,18 @@ [short 15 java/lang/Short /.sipush ..$Short::wrap "SIPUSH" ffi.short_to_long /signed.s2] ) -(template [<name> <type>] - [(template: (<name> <old_extension> <new_extension>) - [(is (-> <type> <type> <type>) - (function (_ parameter subject) - (for @.old - (<old_extension> subject parameter) - - @.jvm - ("jvm object cast" - (<new_extension> ("jvm object cast" parameter) - ("jvm object cast" subject))))))])] +(with_template [<name> <type>] + [(def: <name> + (template (_ <old_extension> <new_extension>) + [(is (-> <type> <type> <type>) + (function (_ parameter subject) + (for @.old + (<old_extension> subject parameter) + + @.jvm + ("jvm object cast" + (<new_extension> ("jvm object cast" parameter) + ("jvm object cast" subject))))))]))] [int/2 java/lang/Integer] [long/2 java/lang/Long] @@ -356,16 +357,17 @@ [double/2 java/lang/Double] ) -(template: (int+long/2 <old_extension> <new_extension>) - [(is (-> java/lang/Integer java/lang/Long java/lang/Long) - (function (_ parameter subject) - (for @.old - (<old_extension> subject parameter) - - @.jvm - ("jvm object cast" - (<new_extension> ("jvm object cast" parameter) - ("jvm object cast" subject))))))]) +(def: int+long/2 + (template (_ <old_extension> <new_extension>) + [(is (-> java/lang/Integer java/lang/Long java/lang/Long) + (function (_ parameter subject) + (for @.old + (<old_extension> subject parameter) + + @.jvm + ("jvm object cast" + (<new_extension> ("jvm object cast" parameter) + ("jvm object cast" subject))))))])) (def: int Test @@ -1056,14 +1058,15 @@ $Long::wrap)))) ))) -(template: (!::= <type> <old> <new>) - [(is (-> <type> Any Bit) - (function (_ expected) - (for @.old - (|>> (as <type>) (<old> expected)) - - @.jvm - (|>> (as <type>) "jvm object cast" (<new> ("jvm object cast" (as <type> expected)))))))]) +(def: !::= + (template (_ <type> <old> <new>) + [(is (-> <type> Any Bit) + (function (_ expected) + (for @.old + (|>> (as <type>) (<old> expected)) + + @.jvm + (|>> (as <type>) "jvm object cast" (<new> ("jvm object cast" (as <type> expected)))))))])) (def: conversion Test diff --git a/stdlib/source/test/lux/target/lua.lux b/stdlib/source/test/lux/target/lua.lux index 38babfca6..fc3c1ac13 100644 --- a/stdlib/source/test/lux/target/lua.lux +++ b/stdlib/source/test/lux/target/lua.lux @@ -79,7 +79,7 @@ [left random.bit right random.bit] (`` (all _.and - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> left right)] (expression (|>> (as Bit) (bit#= expected)) @@ -93,7 +93,7 @@ (/.not (/.boolean left)))) )))) -(template [<bits>] +(with_template [<bits>] [(`` (def: (~~ (template.symbol [int_ <bits>])) (Random Int) (let [mask (|> 1 (i64.left_shifted (-- <bits>)) --)] @@ -114,7 +114,7 @@ random.int) subject random.int] (`` (all _.and - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> left right)] (expression (|>> (as Int) (i.= expected)) @@ -153,7 +153,7 @@ random.safe_frac) subject random.safe_frac] (`` (all _.and - (~~ (template [</> <lux> <pre>] + (~~ (with_template [</> <lux> <pre>] [(_.coverage [</>] (let [expected (<lux> (<pre> parameter) (<pre> subject))] (expression (|>> (as Frac) (f.= expected)) @@ -166,7 +166,7 @@ [/.% f.mod |>] [/.^ f.pow f.abs] )) - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> parameter subject)] (expression (|>> (as Bit) (bit#= expected)) diff --git a/stdlib/source/test/lux/target/python.lux b/stdlib/source/test/lux/target/python.lux index 56e946bd5..c49cc117f 100644 --- a/stdlib/source/test/lux/target/python.lux +++ b/stdlib/source/test/lux/target/python.lux @@ -86,7 +86,7 @@ [left random.bit right random.bit] (`` (all _.and - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> left right)] (expression (|>> (as Bit) (bit#= expected)) @@ -107,7 +107,7 @@ random.safe_frac) subject random.safe_frac] (`` (all _.and - (~~ (template [</> <lux> <pre>] + (~~ (with_template [</> <lux> <pre>] [(_.coverage [</>] (let [expected (<lux> (<pre> parameter) (<pre> subject))] (expression (|>> (as Frac) (f.= expected)) @@ -120,7 +120,7 @@ [/.% f.mod |>] [/.** f.pow f.abs] )) - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> parameter subject)] (expression (|>> (as Bit) (bit#= expected)) @@ -160,7 +160,7 @@ i16 (at ! each ..int_16 random.int) shift (at ! each (n.% 16) random.nat)] (`` (all _.and - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> left right)] (expression (|>> (as Frac) f.int (i.= expected)) @@ -170,7 +170,7 @@ [/.bit_xor i64.xor] [/.bit_and i64.and] )) - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [left (.int shift) right (i.* (.int shift) i16) @@ -451,7 +451,7 @@ field (at ! each /.string (random.upper_case 1))] (all _.and (_.coverage [/.item] - (`` (and (~~ (template [<seq>] + (`` (and (~~ (with_template [<seq>] [(expression (|>> (as Frac) (f.= expected/0)) (/.item (/.int +0) (<seq> (list (/.float expected/0)))))] @@ -500,7 +500,7 @@ (as Frac) (f.= expected/0))) (_.coverage [/.multi] - (`` (and (~~ (template [<var> <value>] + (`` (and (~~ (with_template [<var> <value>] [(|> (..statement (function (_ $output) (all /.then diff --git a/stdlib/source/test/lux/target/ruby.lux b/stdlib/source/test/lux/target/ruby.lux index 62639b7d5..ab5a871ab 100644 --- a/stdlib/source/test/lux/target/ruby.lux +++ b/stdlib/source/test/lux/target/ruby.lux @@ -90,7 +90,7 @@ [left random.bit right random.bit] (`` (all _.and - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> left right)] (expression (|>> (as Bit) (bit#= expected)) @@ -111,7 +111,7 @@ random.safe_frac) subject random.safe_frac] (`` (all _.and - (~~ (template [</> <lux> <pre>] + (~~ (with_template [</> <lux> <pre>] [(_.coverage [</>] (let [expected (<lux> (<pre> parameter) (<pre> subject))] (expression (|>> (as Frac) (f.= expected)) @@ -124,7 +124,7 @@ [/.% f.mod |>] [/.pow f.pow f.abs] )) - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> parameter subject)] (expression (|>> (as Bit) (bit#= expected)) @@ -151,7 +151,7 @@ i16 (at ! each ..int_16 random.int) shift (at ! each (n.% 16) random.nat)] (`` (all _.and - (~~ (template [</> <lux>] + (~~ (with_template [</> <lux>] [(_.coverage [</>] (let [expected (<lux> left right)] (expression (|>> (as Frac) f.int (i.= expected)) diff --git a/stdlib/source/test/lux/time.lux b/stdlib/source/test/lux/time.lux index 5fe4af48e..a054a8990 100644 --- a/stdlib/source/test/lux/time.lux +++ b/stdlib/source/test/lux/time.lux @@ -68,7 +68,7 @@ invalid_minute (|> valid_minute (n.+ /.minutes) (n.min 99)) invalid_second (|> valid_second (n.+ /.seconds) (n.min 99))]] (`` (all _.and - (~~ (template [<cap> <exception> <prefix> <suffix> <valid> <invalid>] + (~~ (with_template [<cap> <exception> <prefix> <suffix> <valid> <invalid>] [(_.coverage [<cap> <exception>] (let [valid! (|> <valid> diff --git a/stdlib/source/test/lux/time/duration.lux b/stdlib/source/test/lux/time/duration.lux index 4abe6f2e6..2d4847d29 100644 --- a/stdlib/source/test/lux/time/duration.lux +++ b/stdlib/source/test/lux/time/duration.lux @@ -83,7 +83,7 @@ (i.= +1 (/.ticks sample sample))) (_.coverage [/.milli_second] (#= /.empty (at /.enum pred /.milli_second))) - (~~ (template [<factor> <big> <small>] + (~~ (with_template [<factor> <big> <small>] [(_.coverage [<big>] (|> <big> (/.ticks <small>) (i.= <factor>)))] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux index c8d3a3c6d..407833523 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux @@ -116,7 +116,7 @@ _ false)) - (~~ (template [<tag> <expected>] + (~~ (with_template [<tag> <expected>] [(_.coverage [<tag>] (case (<tag> <expected>) (pattern (<tag> actual)) @@ -170,7 +170,7 @@ expected_constant (/symbol.random 1 1) expected_variable /variable.random] (`` (all _.and - (~~ (template [<tag> <expected>] + (~~ (with_template [<tag> <expected>] [(_.coverage [<tag>] (case (<tag> <expected>) (pattern (<tag> actual)) @@ -186,13 +186,14 @@ )) )))) -(template: (tagged? <tag> <it>) - [(case <it> - {<tag> _} - true +(def: tagged? + (template (_ <tag> <it>) + [(case <it> + {<tag> _} + true - _ - false)]) + _ + false)])) (def: test|reification Test diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux index 21c47404c..14ed1bef3 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux @@ -84,7 +84,7 @@ [it random.bit] (in [{/.#Bit it} {//pattern.#Simple {//simple.#Bit it}}])) - (~~ (template [<random> <hash> <coverage> <pattern>] + (~~ (with_template [<random> <hash> <coverage> <pattern>] [(do random.monad [it <random>] (in [{<coverage> (set.of_list <hash> (list it))} @@ -266,7 +266,7 @@ (/.composite {/.#Exhaustive}) (try#each (/#= {/.#Exhaustive})) (try.else false)) - (~~ (template [<tag> <hash> <value> <next>] + (~~ (with_template [<tag> <hash> <value> <next>] [(|> (/.composite {<tag> (set.of_list <hash> (list <value>))} {<tag> (set.of_list <hash> (list (|> <value> <next>)))}) (try#each (/#= {<tag> (set.of_list <hash> (list <value> (|> <value> <next>)))})) @@ -416,7 +416,7 @@ (_.coverage [/.redundancy] (let [redundant? (..failure? /.redundancy)] (`` (and (redundant? (/.composite {/.#Exhaustive} {/.#Exhaustive})) - (~~ (template [<it>] + (~~ (with_template [<it>] [(redundant? (/.composite <it> <it>)) (redundant? (/.composite <it> {/.#Exhaustive}))] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux index 86c9c3409..6b7c63309 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux @@ -84,7 +84,7 @@ (def: .public simple_parameter (Random [Type Code]) (`` (all random.either - (~~ (template [<type> <random> <code>] + (~~ (with_template [<type> <random> <code>] [(random#each (|>> <code> [<type>]) <random>)] [.Bit random.bit code.bit] @@ -270,7 +270,7 @@ (not (variant? (type (Maybe type/0)) 0 #1 term/1))) only_bottom_conforms_to_tags_outside_of_range! - (`` (and (~~ (template [<verdict> <term>] + (`` (and (~~ (with_template [<verdict> <term>] [(bit#= <verdict> (variant? variantT arity arbitrary_right? <term>))] [#0 term/0] @@ -293,7 +293,7 @@ 0 #0 (' [])) existential_types_affect_dependent_cases! - (`` (and (~~ (template [<verdict> <term>] + (`` (and (~~ (with_template [<verdict> <term>] [(bit#= <verdict> (variant?' (type (Ex (_ a) (Maybe a))) {.#None} 0 #1 <term>))] [#0 term/0] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux index 9f641f906..d81170a17 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux @@ -94,7 +94,7 @@ (try#each (..new? hash)) (try.else false))) (_.coverage [/.import] - (`` (and (~~ (template [<expected>] + (`` (and (~~ (with_template [<expected>] [(|> (do [! /phase.monad] [_ (/.create hash expected_import) [it ?] (/.with hash name @@ -140,7 +140,7 @@ name (random.lower_case 1) hash random.nat] (`` (all _.and - (~~ (template [<set> <query> <not/0> <not/1>] + (~~ (with_template [<set> <query> <not/0> <not/1>] [(_.coverage [<set> <query>] (|> (do [! /phase.monad] [[it ?] (/.with hash name @@ -159,7 +159,7 @@ [/.set_cached /.cached? /.active? /.compiled?] )) (_.coverage [/.can_only_change_state_of_active_module] - (and (~~ (template [<pre> <post>] + (and (~~ (with_template [<pre> <post>] [(|> (/.with hash name (do /phase.monad [_ (<pre> name)] @@ -180,7 +180,7 @@ [/.set_cached /.set_cached] )))) (_.coverage [/.unknown_module] - (and (~~ (template [<set>] + (and (~~ (with_template [<set>] [(|> (<set> name) (/phase.result state) (pipe.case @@ -220,7 +220,7 @@ alias {.#Alias [module_name def_name]}]] (all _.and (_.coverage [/.define] - (`` (and (~~ (template [<global>] + (`` (and (~~ (with_template [<global>] [(|> (/.with hash module_name (/.define def_name <global>)) (/phase.result state) @@ -242,7 +242,7 @@ {try.#Success _} true {try.#Failure _} false))))) (_.coverage [/.cannot_define_more_than_once] - (`` (and (~~ (template [<global>] + (`` (and (~~ (with_template [<global>] [(|> (/.with hash module_name (do /phase.monad [_ (/.define def_name <global>)] @@ -289,7 +289,7 @@ (at ! each set.list))] (all _.and (_.coverage [/.declare_labels] - (`` (and (~~ (template [<side> <record?> <query> <on_success>] + (`` (and (~~ (with_template [<side> <record?> <query> <on_success>] [(|> (/.with hash module_name (do [! /phase.monad] [.let [it {.#Named [module_name def_name] def_type}] @@ -307,7 +307,7 @@ [.#Right true meta.slot true] [.#Right true meta.tag false]))))) (_.coverage [/.cannot_declare_labels_for_anonymous_type] - (`` (and (~~ (template [<side> <record?>] + (`` (and (~~ (with_template [<side> <record?>] [(|> (/.with hash module_name (do [! /phase.monad] [.let [it def_type] @@ -324,7 +324,7 @@ [.#Left false] [.#Right true]))))) (_.coverage [/.cannot_declare_labels_for_foreign_type] - (`` (and (~~ (template [<side> <record?>] + (`` (and (~~ (with_template [<side> <record?>] [(|> (/.with hash module_name (do [! /phase.monad] [.let [it {.#Named [foreign_module def_name] def_type}] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux index b45859c4f..8c3636a55 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux @@ -61,7 +61,7 @@ _ false)) - (~~ (template [<tag> <value>] + (~~ (with_template [<tag> <value>] [(_.coverage [<tag>] (case (<tag> <value>) (pattern (<tag> actual)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux index 8a4730a35..584eb63b2 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux @@ -32,7 +32,7 @@ ["$[0]" // ["[1][0]" type]]) -(template [<name> <tag>] +(with_template [<name> <tag>] [(def: (<name> expected_type expected_register [actual_type actual_var]) (-> Type Register [Type Variable] Bit) (and (same? expected_type actual_type) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux index 16e9fa6c6..6cc3dd37a 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux @@ -79,7 +79,7 @@ (-> Lux Text [.Bit .Nat .Int .Rev .Frac .Text] Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux]] - (`` (and (~~ (template [<expected> <code> <type> <analysis>] + (`` (and (~~ (with_template [<expected> <code> <type> <analysis>] [(|> (do phase.monad [[:it: it] (|> <expected> <code> @@ -138,7 +138,7 @@ (phase#each (|>> product.right product.right)) (phase.result state) (try.else false)) - (~~ (template [<lefts> <right> <expected> <tag> <code> <analysis>] + (~~ (with_template [<lefts> <right> <expected> <tag> <code> <analysis>] [(|> (do phase.monad [it (|> (code.variant (list (code.nat <lefts>) (code.bit <right>) (<code> <expected>))) (/.phase ..expander archive.empty) @@ -252,7 +252,7 @@ (phase#each (|>> product.right product.right)) (phase.result state) (try.else false)) - (~~ (template [<lefts> <right> <expected> <tag> <code> <analysis>] + (~~ (with_template [<lefts> <right> <expected> <tag> <code> <analysis>] [(|> (do phase.monad [_ (//module.declare_labels false tags/* false :variant:) [:it: it] (|> (code.variant (list (code.local <tag>) (<code> <expected>))) @@ -668,7 +668,7 @@ slots/* (list @any @bit @nat @int @rev @frac @text) simple! - (`` (and (~~ (template [<input> <code> <analysis> <pattern>] + (`` (and (~~ (with_template [<input> <code> <analysis> <pattern>] [(|> (do phase.monad [[:it: it] (|> (` ({(~ $parameter/0) (~ (code.frac frac/0))} (~ (<code> <input>)))) (/.phase ..expander archive.empty) @@ -755,7 +755,7 @@ (try.else false)) variant! - (`` (and (~~ (template [<lefts> <right?> <expected> <tag> <code> <analysis> <pattern>] + (`` (and (~~ (with_template [<lefts> <right?> <expected> <tag> <code> <analysis> <pattern>] [(|> (do phase.monad [_ (//module.declare_labels false tags/* false :variant:) [:it: it] (|> (` ({{(~ (code.local <tag>)) (~ (<code> <expected>))} @@ -935,7 +935,7 @@ (..can_analyse_pattern_matching! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] $parameter/0) )) (_.coverage [/.invalid] - (`` (and (~~ (template [<syntax>] + (`` (and (~~ (with_template [<syntax>] [(|> (do phase.monad [_ (|> <syntax> (/.phase ..expander archive.empty) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux index c991c5850..aecf1d14b 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux @@ -90,7 +90,7 @@ (def: simple_parameter (Random [Type Code]) (`` (all random.either - (~~ (template [<type> <random> <code>] + (~~ (with_template [<type> <random> <code>] [(random#each (|>> <code> [<type>]) <random>)] [.Bit random.bit code.bit] @@ -115,7 +115,7 @@ (analysed? expected actual)) (list.zipped_2 expected actual))) - (^.template [<expected> <actual>] + (^.with_template [<expected> <actual>] [(pattern [[_ {<expected> expected}] (<actual> actual)]) (same? expected actual)]) ([.#Bit //analysis.bit] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux index 66d8d5833..03a9dc1e6 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux @@ -66,15 +66,16 @@ _ false)))) -(template: (analysis? <type> <tag>) - [(is (-> <type> Analysis Bit) - (function (_ expected) - (|>> (pipe.case - (pattern (<tag> actual)) - (same? expected actual) +(def: analysis? + (template (_ <type> <tag>) + [(is (-> <type> Analysis Bit) + (function (_ expected) + (|>> (pipe.case + (pattern (<tag> actual)) + (same? expected actual) - _ - false))))]) + _ + false))))])) (def: .public test (<| (_.covering /._) @@ -88,7 +89,7 @@ (_.coverage [/.unit] (..analysis state module .Any /.unit (|>> (pipe.case (pattern (/analysis.unit)) true _ false)))) - (~~ (template [<analysis> <type> <random> <tag>] + (~~ (with_template [<analysis> <type> <random> <tag>] [(do ! [sample <random>] (_.coverage [<analysis>] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux index b2e9131ca..0123bd0bc 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux @@ -33,7 +33,7 @@ [meta ["[0]" archive]]]]]]) -(template [<name> <success> <failure>] +(with_template [<name> <success> <failure>] [(def: (<name> procedure params output_type) (-> Text (List Code) Type Bit) (|> (////scope.with_scope "" diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 11cadf681..4a79735c7 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -195,7 +195,7 @@ _ (undefined)))))) -(template [<name> <hash> <random> <path> <synthesis> <pattern> <analysis>] +(with_template [<name> <hash> <random> <path> <synthesis> <pattern> <analysis>] [(def: <name> (Random [Path Match]) (do [! random.monad] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux index 9ec225645..9dae4cabc 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -63,13 +63,14 @@ body (list.reversed (list.indices arity)))) -(template: (!expect <pattern> <value>) - (case <value> - <pattern> - true - - _ - false)) +(def: !expect + (template (_ <pattern> <value>) + (case <value> + <pattern> + true + + _ + false))) (type: Circumstance (Record @@ -87,7 +88,7 @@ (synthesis.text synthesis.unit) (analysis.unit)])) -(template [<name> <random> <synthesis> <analysis>] +(with_template [<name> <random> <synthesis> <analysis>] [(def: (<name> output?) Scenario (do [! random.monad] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux index 6c17b1883..c123d5ef7 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux @@ -29,7 +29,7 @@ (def: (primitive offset arity next) (Scenario Synthesis) (`` (all random.either - (~~ (template [<synthesis> <random>] + (~~ (with_template [<synthesis> <random>] [(do [! random.monad] [example (at ! each (|>> <synthesis>) <random>)] (in [next @@ -72,7 +72,7 @@ (def: (reference offset arity next) (Scenario Synthesis) (`` (all random.either - (~~ (template [<tag> <random>] + (~~ (with_template [<tag> <random>] [(do [! random.monad] [[next [exampleE exampleA]] (<random> offset arity next)] (in [next @@ -115,7 +115,7 @@ (random#in [next [//.path/pop //.path/pop]]) - (~~ (template [<path> <random>] + (~~ (with_template [<path> <random>] [(do [! random.monad] [example (at ! each (|>> <path>) <random>)] (in [next @@ -127,7 +127,7 @@ [//.path/f64 random.frac] [//.path/text (random.unicode 1)] )) - (~~ (template [<path>] + (~~ (with_template [<path>] [(do [! random.monad] [example (at ! each (|>> <path>) (random.or random.nat diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux index 3e6cdda9c..fc6758d5a 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux @@ -45,7 +45,7 @@ (def: .public (corresponds? analysis synthesis) (-> Analysis Synthesis Bit) (`` (case [analysis synthesis] - (~~ (template [<analysis> <post_analysis> <synthesis> <post_synthesis>] + (~~ (with_template [<analysis> <post_analysis> <synthesis> <post_synthesis>] [[{////analysis.#Primitive {<analysis> expected}} {////synthesis.#Primitive {<synthesis> actual}}] (same? (|> expected <post_analysis>) @@ -75,7 +75,7 @@ Test (<| (_.context (%.symbol (symbol ////synthesis.#Primitive))) (`` (all _.and - (~~ (template [<analysis> <synthesis> <generator>] + (~~ (with_template [<analysis> <synthesis> <generator>] [(do r.monad [expected <generator>] (_.property (%.symbol (symbol <synthesis>)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index 4f3d1de26..8d284b15f 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -27,13 +27,14 @@ [reference ["[0]" variable]]]]]]) -(template: (!expect <pattern> <value>) - (case <value> - <pattern> - true - - _ - false)) +(def: !expect + (template (_ <pattern> <value>) + (case <value> + <pattern> + true + + _ + false))) (type: Context [#redundants Nat @@ -42,7 +43,7 @@ (type: (Scenario a) (-> Context (Random [a a]))) -(template [<name> <synthesis> <random>] +(with_template [<name> <synthesis> <random>] [(def: (<name> context) (Scenario Synthesis) (do [! random.monad] @@ -178,7 +179,7 @@ {synthesis.#Seq {synthesis.#Pop} {synthesis.#Then actual_then}}}]))) (all random.either - (~~ (template [<tag> <random>] + (~~ (with_template [<tag> <random>] [(do [! random.monad] [test <random> [expected_then actual_then] (scenario context)] diff --git a/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux index 8fa2fc9e6..ec53d9f99 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux @@ -29,13 +29,14 @@ ["[0]" artifact (.only) ["[0]" category]]]]]) -(template: (tagged? <tag> <it>) - [(case <it> - {<tag> _} - true - - _ - false)]) +(def: tagged? + (template (_ <tag> <it>) + [(case <it> + {<tag> _} + true + + _ + false)])) (def: random_dependency (Random unit.ID) @@ -78,7 +79,7 @@ _ false))) - (~~ (template [<new> <expected>' <query> <tag> <wrong_new> <wrong_expected>'] + (~~ (with_template [<new> <expected>' <query> <tag> <wrong_new> <wrong_expected>'] [(_.coverage [<new> <query>] (let [<expected> <expected>' <wrong_expected> <wrong_expected>'] @@ -119,7 +120,7 @@ [/.custom expected_name /.customs category.#Custom /.definition (is category.Definition [expected_name {.#None}])] )) (_.coverage [/.id] - (and (~~ (template [<new> <expected>' <name>] + (and (~~ (with_template [<new> <expected>' <name>] [(let [<expected> <expected>' [@expected registry] (<new> <expected> mandatory? expected_dependencies /.empty)] (|> (/.id (<name> <expected>) registry) @@ -134,7 +135,7 @@ [/.custom expected_name |>] )))) (_.coverage [/.artifacts] - (and (~~ (template [<new> <query> <equivalence> <$>] + (and (~~ (with_template [<new> <query> <equivalence> <$>] [(let [expected/* (list#each <$> expected_names) [ids registry] (is [(Sequence artifact.ID) /.Registry] (list#mix (function (_ expected [ids registry]) @@ -159,7 +160,7 @@ [/.custom /.customs text.equivalence (|>>)] )))) (_.coverage [/.writer /.parser] - (and (~~ (template [<new> <expected>' <name>] + (and (~~ (with_template [<new> <expected>' <name>] [(let [<expected> <expected>' [@expected before] (<new> <expected> mandatory? expected_dependencies /.empty)] (|> before diff --git a/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux b/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux index 3975036e0..30dd30486 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux @@ -21,7 +21,7 @@ (`` (implementation: (bad it) (-> (file.System Async) (file.System Async)) - (~~ (template [<name>] + (~~ (with_template [<name>] [(def: <name> (at it <name>))] diff --git a/stdlib/source/test/lux/tool/compiler/meta/cli.lux b/stdlib/source/test/lux/tool/compiler/meta/cli.lux index cc1951950..9617831ab 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/cli.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/cli.lux @@ -55,7 +55,7 @@ (all _.and (_.for [/.Compilation] (`` (all _.and - (~~ (template [<type> <slot> <?>] + (~~ (with_template [<type> <slot> <?>] [(_.coverage [<type>] (|> (partial_list "build" compilation') (<cli>.result /.service) @@ -79,7 +79,7 @@ )) ))) (_.coverage [/.Interpretation] - (`` (and (~~ (template [<slot> <?>] + (`` (and (~~ (with_template [<slot> <?>] [(|> (partial_list "repl" compilation') (<cli>.result /.service) (try#each (|>> (pipe.case @@ -101,7 +101,7 @@ [/.#configuration (configuration#= configuration)] ))))) (_.coverage [/.Export] - (`` (and (~~ (template [<side> <?>] + (`` (and (~~ (with_template [<side> <?>] [(|> (partial_list "export" export) (<cli>.result /.service) (try#each (|>> (pipe.case @@ -118,7 +118,7 @@ [product.right (same? target)] ))))) (_.coverage [/.target] - (`` (and (~~ (template [<it>] + (`` (and (~~ (with_template [<it>] [(same? target (/.target <it>))] [{/.#Compilation [/.#host_dependencies host_dependencies diff --git a/stdlib/source/test/lux/tool/compiler/meta/context.lux b/stdlib/source/test/lux/tool/compiler/meta/context.lux index 9c993c22a..41c2adf26 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/context.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/context.lux @@ -41,7 +41,7 @@ (/.python target) (/.ruby target)) maximum (list.size contexts)] - (`` (and (~~ (template [<amount> <slot>] + (`` (and (~~ (with_template [<amount> <slot>] [(|> contexts (list#each (the <slot>)) (set.of_list text.hash) diff --git a/stdlib/source/test/lux/tool/compiler/reference.lux b/stdlib/source/test/lux/tool/compiler/reference.lux index 183e872ff..1991765de 100644 --- a/stdlib/source/test/lux/tool/compiler/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/reference.lux @@ -49,7 +49,7 @@ (_.for [/.hash] ($hash.spec /.hash ..random)) - (~~ (template [<tag>] + (~~ (with_template [<tag>] [(_.coverage [<tag>] (case (<tag> expected_register) (pattern (<tag> actual_register)) diff --git a/stdlib/source/test/lux/tool/compiler/version.lux b/stdlib/source/test/lux/tool/compiler/version.lux index cd3bf39ee..88cb62e09 100644 --- a/stdlib/source/test/lux/tool/compiler/version.lux +++ b/stdlib/source/test/lux/tool/compiler/version.lux @@ -30,7 +30,7 @@ (_.coverage [/.format] (bit#= (n.= this that) (text#= (/.format this) (/.format that)))) - (~~ (template [<level>] + (~~ (with_template [<level>] [(_.coverage [<level>] (text.contains? (%.nat (<level> this)) (/.format this)))] diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux index 6279c98ac..299da6fc7 100644 --- a/stdlib/source/test/lux/type.lux +++ b/stdlib/source/test/lux/type.lux @@ -108,7 +108,7 @@ .let [(open "/#[0]") /.equivalence (open "list#[0]") (list.equivalence /.equivalence)]] (`` (all _.and - (~~ (template [<ctor> <dtor> <unit>] + (~~ (with_template [<ctor> <dtor> <unit>] [(_.coverage [<ctor> <dtor>] (let [flat (|> members <ctor> <dtor>)] (or (list#= members flat) @@ -161,7 +161,7 @@ #1)))) .let [(open "/#[0]") /.equivalence]] (`` (all _.and - (~~ (template [<ctor> <dtor>] + (~~ (with_template [<ctor> <dtor>] [(_.coverage [<ctor> <dtor>] (let [[flat_size flat_body] (|> body_type (<ctor> size) <dtor>)] (and (n.= size flat_size) diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux index 292cb35c1..31c2efd14 100644 --- a/stdlib/source/test/lux/type/check.lux +++ b/stdlib/source/test/lux/type/check.lux @@ -79,7 +79,7 @@ {.#Ex id} #1 - (^.template [<tag>] + (^.with_template [<tag>] [{<tag> left right} (and (valid_type? left) (valid_type? right))]) @@ -419,7 +419,7 @@ parameters_matter! covariant_parameters!))) -(template [<assertion> <combinator>] +(with_template [<assertion> <combinator>] [(def: (<assertion> name/0 name/1) (-> Text Text Bit) (let [pair/0 {<combinator> {.#Primitive name/0 (list)} {.#Primitive name/0 (list)}} @@ -695,7 +695,7 @@ anonymousT dirty_type] (in (function (_ holeT) {.#Named [module short] (anonymousT holeT)}))) - (~~ (template [<tag>] + (~~ (with_template [<tag>] [(do random.monad [leftT dirty_type rightT dirty_type] @@ -712,7 +712,7 @@ parameterT dirty_type] (in (function (_ holeT) {.#Primitive name (list (parameterT holeT))}))) - (~~ (template [<tag>] + (~~ (with_template [<tag>] [(do [! random.monad] [funcT dirty_type argT dirty_type @@ -820,7 +820,7 @@ {.#Function left right})) )))) -(template [<tag> <name>] +(with_template [<tag> <name>] [(def: <name> (Random Bit) (do random.monad diff --git a/stdlib/source/test/lux/type/primitive.lux b/stdlib/source/test/lux/type/primitive.lux index 8ef01f41f..dd544ceb8 100644 --- a/stdlib/source/test/lux/type/primitive.lux +++ b/stdlib/source/test/lux/type/primitive.lux @@ -24,7 +24,7 @@ ["[0]" /]]) (template.with_locals [g!Foo g!Bar] - (these (template [<syntax> <meta>] + (these (with_template [<syntax> <meta>] [(def: <syntax> (syntax (_ []) (do meta.monad diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux index 3de50b8a7..2182c600e 100644 --- a/stdlib/source/test/lux/type/resource.lux +++ b/stdlib/source/test/lux/type/resource.lux @@ -34,7 +34,7 @@ .let [! identity.monad]] (_.for [/.Linear /.run! /.monad] (`` (all _.and - (~~ (template [<coverage> <bindings>] + (~~ (with_template [<coverage> <bindings>] [(_.coverage <coverage> (<| (text#= (format pre post)) (is (Identity Text)) @@ -76,7 +76,7 @@ .let [! io.monad]] (_.for [/.Linear /.run! /.monad] (`` (all _.and - (~~ (template [<coverage> <bindings>] + (~~ (with_template [<coverage> <bindings>] [(_.coverage <coverage> (<| (text#= (format pre post)) io.run! @@ -119,7 +119,7 @@ .let [! async.monad]] (_.for [/.Linear /.run! /.monad] (`` (all _.and - (~~ (template [<coverage> <bindings>] + (~~ (with_template [<coverage> <bindings>] [(in (monad.do ! [outcome (<| (is (Async Text)) (/.run! !) @@ -179,7 +179,7 @@ ..async (_.coverage [/.amount_cannot_be_zero] - (`` (and (~~ (template [<group|un_group>] + (`` (and (~~ (with_template [<group|un_group>] [(with_error /.amount_cannot_be_zero (<group|un_group> 0))] diff --git a/stdlib/source/test/lux/type/unit.lux b/stdlib/source/test/lux/type/unit.lux index edf3fe6bd..1006d9dbb 100644 --- a/stdlib/source/test/lux/type/unit.lux +++ b/stdlib/source/test/lux/type/unit.lux @@ -22,7 +22,7 @@ [\\library ["[0]" /]]) -(template [<name> <type> <unit>] +(with_template [<name> <type> <unit>] [(def: (<name> range) (-> Nat (Random (/.Qty <type>))) (|> random.int @@ -53,7 +53,7 @@ [expected random.int] (_.for [/.Unit] (`` (all _.and - (~~ (template [<type> <unit>] + (~~ (with_template [<type> <unit>] [(_.coverage [<type> <unit>] (|> expected (at <unit> in) @@ -110,7 +110,7 @@ (at ! each (at /.meter in)))] (_.for [/.Scale] (`` (all _.and - (~~ (template [<type> <scale>] + (~~ (with_template [<type> <scale>] [(_.coverage [<type> <scale>] (|> large (at <scale> scale) @@ -123,7 +123,7 @@ [/.Mega /.mega] [/.Giga /.giga] )) - (~~ (template [<type> <scale>] + (~~ (with_template [<type> <scale>] [(_.coverage [<type> <scale>] (|> small (at <scale> scale) @@ -163,7 +163,7 @@ right (..meter 1,000) extra (..second 1,000)] (`` (all _.and - (~~ (template [<q> <i>] + (~~ (with_template [<q> <i>] [(_.coverage [<q>] (i.= (<i> (at /.meter out left) (at /.meter out right)) (at /.meter out (<q> left right))))] diff --git a/stdlib/source/test/lux/world/input/keyboard.lux b/stdlib/source/test/lux/world/input/keyboard.lux index 4e9db7301..6d3daa301 100644 --- a/stdlib/source/test/lux/world/input/keyboard.lux +++ b/stdlib/source/test/lux/world/input/keyboard.lux @@ -112,7 +112,7 @@ /.f24]])] (def: listing (List /.Key) - (list.together (`` (list (~~ (template [<definition> <keys>] + (list.together (`` (list (~~ (with_template [<definition> <keys>] [((is (-> Any (List /.Key)) (function (_ _) (`` (list (~~ (template.spliced <keys>)))))) @@ -128,7 +128,7 @@ (n.= (list.size ..listing) (set.size ..catalogue))) - (template [<definition> <keys>] + (with_template [<definition> <keys>] [(def: <definition> Test (_.coverage <keys> @@ -148,14 +148,14 @@ (<| (_.covering /._) (_.for [/.Key]) (`` (all _.and - (~~ (template [<definition> <keys>] + (~~ (with_template [<definition> <keys>] [<definition>] <groups>)) (_.for [/.Press] (`` (all _.and - (~~ (template [<pressed?> <function>] + (~~ (with_template [<pressed?> <function>] [(do random.monad [key ..random .let [sample (<function> key)]] diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux index 380e3a257..4123cf264 100644 --- a/stdlib/source/test/lux/world/net/http/client.lux +++ b/stdlib/source/test/lux/world/net/http/client.lux @@ -98,7 +98,7 @@ [/.options on_options] [/.trace on_trace])] (`` (all _.and - (~~ (template [<definition> <expected>] + (~~ (with_template [<definition> <expected>] [(_.coverage [<definition>] (|> (<definition> "" //.empty {.#None} mock) (verification io.monad <expected>) @@ -114,13 +114,13 @@ dictionary.size))) (in (do [! async.monad] [.let [mock (/.async mock)] - (~~ (template [<definition> <expected>] + (~~ (with_template [<definition> <expected>] [<expected> (|> (<definition> "" //.empty {.#None} mock) (verification ! <expected>))] <cases>))] (_.coverage' [/.async] - (and (~~ (template [<definition> <expected>] + (and (~~ (with_template [<definition> <expected>] [<expected>] <cases>)))))) diff --git a/stdlib/source/test/lux/world/net/http/status.lux b/stdlib/source/test/lux/world/net/http/status.lux index fe1a74690..28789a09a 100644 --- a/stdlib/source/test/lux/world/net/http/status.lux +++ b/stdlib/source/test/lux/world/net/http/status.lux @@ -84,7 +84,7 @@ /.network_authentication_required]])] (def: all (List //.Status) - (list.together (`` (list (~~ (template [<category> <status+>] + (list.together (`` (list (~~ (with_template [<category> <status+>] [((is (-> Any (List //.Status)) (function (_ _) (`` (list (~~ (template.spliced <status+>)))))) @@ -100,7 +100,7 @@ (n.= (list.size ..all) (set.size ..unique))) - (template [<category> <status+>] + (with_template [<category> <status+>] [(def: <category> Test (_.coverage <status+> @@ -112,7 +112,7 @@ Test (<| (_.covering /._) (`` (.all _.and - (~~ (template [<category> <status+>] + (~~ (with_template [<category> <status+>] [<category>] <categories>)) |