aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2022-09-02 22:30:48 -0400
committerEduardo Julian2022-09-02 22:30:48 -0400
commit950836e72a1b775ccab19a722566c431f56208f6 (patch)
treed48e07019fc67f8e234d06847ca14d612027817f /stdlib/source/test
parent3b571c140a3bee7ec715df9f9cf37645883b9397 (diff)
Made labels (tags & slots) into normal definitions.
Diffstat (limited to 'stdlib/source/test')
-rw-r--r--stdlib/source/test/lux/data/format/json.lux2
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/analysis/module.lux76
-rw-r--r--stdlib/source/test/lux/meta/macro/context.lux19
3 files changed, 7 insertions, 90 deletions
diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux
index 0b5dca612..e04705902 100644
--- a/stdlib/source/test/lux/data/format/json.lux
+++ b/stdlib/source/test/lux/data/format/json.lux
@@ -1,6 +1,6 @@
(.require
[library
- [lux (.except Variant Record)
+ [lux (.except Variant Record #Bit #Text #Frac)
[abstract
[codec (.except)]
[monad (.only do)]
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/module.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/module.lux
index 58a2e03fa..7442e7a3c 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/module.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/module.lux
@@ -269,80 +269,6 @@
{try.#Failure _} true)))))
)))
-(def test|label
- Test
- (do [! random.monad]
- [lux ..random_state
- .let [state [/extension.#bundle /extension.empty
- /extension.#state lux]]
- module_name (random.lower_case 1)
- hash random.nat
- def_name (random.lower_case 2)
- foreign_module (random.lower_case 3)
-
- public? random.bit
- def_type ..primitive
- arity (at ! each (|>> (n.% 10) ++) random.nat)
- labels|head (random.lower_case 1)
- labels|tail (|> (random.lower_case 1)
- (random.only (|>> (text#= labels|head) not))
- (random.set text.hash (-- arity))
- (at ! each set.list))]
- (all _.and
- (_.coverage [/.declare_labels]
- (`` (and (,, (with_template [<side> <record?> <query> <on_success>]
- [(|> (/.with hash module_name
- (do [! /phase.monad]
- [.let [it {.#Named [module_name def_name] def_type}]
- _ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})
- _ (/.declare_labels <record?> (list.partial labels|head labels|tail) public? it)]
- (monad.each ! (|>> [module_name] <query> /extension.lifted)
- (list.partial labels|head labels|tail))))
- (/phase.result state)
- (pipe.when
- {try.#Success _} <on_success>
- {try.#Failure _} (not <on_success>)))]
-
- [.#Left false meta.tag true]
- [.#Left false meta.slot false]
- [.#Right true meta.slot true]
- [.#Right true meta.tag false])))))
- (_.coverage [/.cannot_declare_labels_for_anonymous_type]
- (`` (and (,, (with_template [<side> <record?>]
- [(|> (/.with hash module_name
- (do [! /phase.monad]
- [.let [it def_type]
- _ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})]
- (/.declare_labels <record?> (list.partial labels|head labels|tail) public? it)))
- (/phase.result state)
- (pipe.when
- {try.#Success _}
- false
-
- {try.#Failure error}
- (text.contains? (the exception.#label /.cannot_declare_labels_for_anonymous_type) error)))]
-
- [.#Left false]
- [.#Right true])))))
- (_.coverage [/.cannot_declare_labels_for_foreign_type]
- (`` (and (,, (with_template [<side> <record?>]
- [(|> (/.with hash module_name
- (do [! /phase.monad]
- [.let [it {.#Named [foreign_module def_name] def_type}]
- _ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})]
- (/.declare_labels <record?> (list.partial labels|head labels|tail) public? it)))
- (/phase.result state)
- (pipe.when
- {try.#Success _}
- false
-
- {try.#Failure error}
- (text.contains? (the exception.#label /.cannot_declare_labels_for_foreign_type) error)))]
-
- [.#Left false]
- [.#Right true])))))
- )))
-
(def .public test
Test
(<| (_.covering /._)
@@ -350,6 +276,4 @@
..test|module
..test|state
..test|definition
- (_.for [/.Label]
- ..test|label)
)))
diff --git a/stdlib/source/test/lux/meta/macro/context.lux b/stdlib/source/test/lux/meta/macro/context.lux
index 095fed836..49ebbe6db 100644
--- a/stdlib/source/test/lux/meta/macro/context.lux
+++ b/stdlib/source/test/lux/meta/macro/context.lux
@@ -113,19 +113,12 @@
[_ (/.revised {.#None} ++ <real_stack>)]
(in (list)))))))
(_.coverage [/.not_a_definition]
- (and (<| (text.contains? (the exception.#label /.not_a_definition))
- macro_error
- static.expansion
- (do meta.monad
- [actual (/.peek' [<real_stack> (symbol <fake_stack>)])]
- (in (list))))
- (with_expansions [<expected> (static.random_nat)]
- (<| (text.contains? (the exception.#label /.not_a_definition))
- macro_error
- static.expansion
- (do meta.monad
- [_ (/.push' <expected> [<real_stack> (symbol .#Item)])]
- (in (list)))))))
+ (<| (text.contains? (the exception.#label /.not_a_definition))
+ macro_error
+ static.expansion
+ (do meta.monad
+ [actual (/.peek' [<real_stack> (symbol <fake_stack>)])]
+ (in (list)))))
(_.coverage [/.not_a_global]
(with_expansions [<expected> (static.random_nat)]
(<| (text.contains? (the exception.#label /.not_a_global))