diff options
author | Eduardo Julian | 2020-12-23 06:33:44 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-23 06:33:44 -0400 |
commit | d29e091e98dabb8dfcf816899ada480ecbf7e357 (patch) | |
tree | a9d34c7fbb700cdb0c1f1226d377150614ce9914 /stdlib/source/test/lux/macro | |
parent | cad959345afb8bf0bd1e5eefe6c63f136833b3ce (diff) |
Refactored "export" common syntax.
Diffstat (limited to 'stdlib/source/test/lux/macro')
-rw-r--r-- | stdlib/source/test/lux/macro/syntax/common.lux | 15 | ||||
-rw-r--r-- | stdlib/source/test/lux/macro/syntax/common/definition.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/macro/syntax/common/export.lux | 29 |
3 files changed, 33 insertions, 13 deletions
diff --git a/stdlib/source/test/lux/macro/syntax/common.lux b/stdlib/source/test/lux/macro/syntax/common.lux index 98b3cdc0c..592baa036 100644 --- a/stdlib/source/test/lux/macro/syntax/common.lux +++ b/stdlib/source/test/lux/macro/syntax/common.lux @@ -30,7 +30,8 @@ ["#." code]] ["." / #_ ["#." check] - ["#." definition]]) + ["#." definition] + ["#." export]]) (def: annotations-equivalence (Equivalence /.Annotations) @@ -59,17 +60,6 @@ (_.covering /reader._) (_.covering /writer._) ($_ _.and - (do random.monad - [expected random.bit] - (_.cover [/reader.export /writer.export] - (|> expected - /writer.export - (<c>.run /reader.export) - (case> (#try.Success actual) - (bit\= expected actual) - - (#try.Failure error) - false)))) (_.for [/.Annotations] ($_ _.and (do random.monad @@ -138,4 +128,5 @@ /check.test /definition.test + /export.test ))) diff --git a/stdlib/source/test/lux/macro/syntax/common/definition.lux b/stdlib/source/test/lux/macro/syntax/common/definition.lux index 4e3352e40..18af3edaa 100644 --- a/stdlib/source/test/lux/macro/syntax/common/definition.lux +++ b/stdlib/source/test/lux/macro/syntax/common/definition.lux @@ -69,7 +69,7 @@ (do random.monad [expected ..random - + type $////code.random untyped-value $////code.random] ($_ _.and diff --git a/stdlib/source/test/lux/macro/syntax/common/export.lux b/stdlib/source/test/lux/macro/syntax/common/export.lux new file mode 100644 index 000000000..59b72eb0f --- /dev/null +++ b/stdlib/source/test/lux/macro/syntax/common/export.lux @@ -0,0 +1,29 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [control + ["." try] + [parser + ["<.>" code]]] + [data + ["." bit ("#\." equivalence)]] + [math + ["." random]]] + {1 + ["." /]}) + +(def: #export test + Test + (<| (_.covering /._) + (do random.monad + [expected random.bit] + (_.cover [/.write /.parser] + (case (<code>.run /.parser + (/.write expected)) + (#try.Failure _) + false + + (#try.Success actual) + (bit\= expected actual)))))) |