aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r--stdlib/source/test/lux/data/format/json.lux29
-rw-r--r--stdlib/source/test/lux/data/text/escape.lux22
-rw-r--r--stdlib/source/test/lux/data/text/regex.lux40
3 files changed, 49 insertions, 42 deletions
diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux
index c0d9f7537..a4874021b 100644
--- a/stdlib/source/test/lux/data/format/json.lux
+++ b/stdlib/source/test/lux/data/format/json.lux
@@ -26,7 +26,7 @@
["n" nat]
["[0]" frac]]]
["[0]" macro (.only)
- ["[0]" syntax (.only syntax:)]
+ ["[0]" syntax (.only syntax)]
["[0]" code]]]]
[\\library
["[0]" / (.only JSON) (.open: "[1]#[0]" equivalence)]])
@@ -46,20 +46,23 @@
(random.dictionary text.hash size (random.unicode size) again)
)))))
-(syntax: (boolean [])
- (do meta.monad
- [value meta.seed]
- (in (list (code.bit (n.even? value))))))
+(def: boolean
+ (syntax (_ [])
+ (do meta.monad
+ [value meta.seed]
+ (in (list (code.bit (n.even? value)))))))
-(syntax: (number [])
- (do meta.monad
- [value meta.seed]
- (in (list (code.frac (n.frac value))))))
+(def: number
+ (syntax (_ [])
+ (do meta.monad
+ [value meta.seed]
+ (in (list (code.frac (n.frac value)))))))
-(syntax: (string [])
- (do meta.monad
- [value (macro.symbol "string")]
- (in (list (code.text (%.code value))))))
+(def: string
+ (syntax (_ [])
+ (do meta.monad
+ [value (macro.symbol "string")]
+ (in (list (code.text (%.code value)))))))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux
index d1258bf25..8a897d348 100644
--- a/stdlib/source/test/lux/data/text/escape.lux
+++ b/stdlib/source/test/lux/data/text/escape.lux
@@ -18,7 +18,7 @@
[collection
["[0]" set (.only Set)]]]
[macro
- [syntax (.only syntax:)]
+ [syntax (.only syntax)]
["[0]" code]
["[0]" template]]
[math
@@ -69,16 +69,18 @@
(debug.private /.\\_sigil)
(debug.private /.\u_sigil))))
-(syntax: (static_sample [])
- (do meta.monad
- [seed meta.seed
- .let [[_ expected] (|> (random.ascii 10)
- (random.only (|>> (text.contains? text.\0) not))
- (random.result (random.pcg_32 [seed seed])))]]
- (in (list (code.text expected)))))
+(def: static_sample
+ (syntax (_ [])
+ (do meta.monad
+ [seed meta.seed
+ .let [[_ expected] (|> (random.ascii 10)
+ (random.only (|>> (text.contains? text.\0) not))
+ (random.result (random.pcg_32 [seed seed])))]]
+ (in (list (code.text expected))))))
-(syntax: (static_escaped [un_escaped <code>.text])
- (in (list (code.text (/.escaped un_escaped)))))
+(def: static_escaped
+ (syntax (_ [un_escaped <code>.text])
+ (in (list (code.text (/.escaped un_escaped))))))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux
index c16388e4e..43a34d694 100644
--- a/stdlib/source/test/lux/data/text/regex.lux
+++ b/stdlib/source/test/lux/data/text/regex.lux
@@ -14,7 +14,7 @@
["[0]" text (.open: "[1]#[0]" equivalence)
["%" format (.only format)]]]
["[0]" macro (.only)
- [syntax (.only syntax:)]
+ [syntax (.only syntax)]
["[0]" code]]
[math
[number (.only hex)]
@@ -55,18 +55,19 @@
_
false)))
-(syntax: (should_check [pattern <code>.any
- regex <code>.any
- input <code>.any])
- (macro.with_symbols [g!message g!_]
- (in (list (` (|> (~ input)
- (<text>.result (~ regex))
- (pipe.case
- (pattern {try.#Success (~ pattern)})
- true
+(def: should_check
+ (syntax (_ [pattern <code>.any
+ regex <code>.any
+ input <code>.any])
+ (macro.with_symbols [g!message g!_]
+ (in (list (` (|> (~ input)
+ (<text>.result (~ regex))
+ (pipe.case
+ (pattern {try.#Success (~ pattern)})
+ true
- (~ g!_)
- false)))))))
+ (~ g!_)
+ false))))))))
(def: basics
Test
@@ -276,14 +277,15 @@
"123-456-7890")))
))
-(syntax: (expands? [form <code>.any])
- (function (_ lux)
- {try.#Success [lux (list (code.bit (case (macro.single_expansion form lux)
- {try.#Success _}
- true
+(def: expands?
+ (syntax (_ [form <code>.any])
+ (function (_ lux)
+ {try.#Success [lux (list (code.bit (case (macro.single_expansion form lux)
+ {try.#Success _}
+ true
- {try.#Failure error}
- false)))]}))
+ {try.#Failure error}
+ false)))]})))
(def: .public test
Test