aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2017-01-12 23:10:38 -0400
committerEduardo Julian2017-01-12 23:10:38 -0400
commit4a039138dd87e2c2f232f9ce7198b4e36ca403f9 (patch)
tree94789923d313f21155e6022f390a0379d1e8f122 /stdlib/test
parentc12eeb2b91cc6944363476307ede89b3a6b0524a (diff)
- Simplified the macros for asking about or ensuring AST tokens.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/macro/syntax.lux28
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux
index aaa042fb3..1fabb09ad 100644
--- a/stdlib/test/test/lux/macro/syntax.lux
+++ b/stdlib/test/test/lux/macro/syntax.lux
@@ -70,21 +70,21 @@
## [Tests]
(test: "Simple value syntax."
- (let% [<simple-tests> (do-template [<assertion> <value> <ctor> <Eq> <get> <ask> <demand>]
+ (let% [<simple-tests> (do-template [<assertion> <value> <ctor> <Eq> <get>]
[(assert <assertion>
(and (is? <Eq> <value> <get> (list (<ctor> <value>)))
- (found? (<ask> <value>) (list (<ctor> <value>)))
- (enforced? (<demand> <value>) (list (<ctor> <value>)))))]
+ (found? (s;sample? (<ctor> <value>)) (list (<ctor> <value>)))
+ (enforced? (s;sample! (<ctor> <value>)) (list (<ctor> <value>)))))]
- ["Can parse Bool syntax." true ast;bool bool;Eq<Bool> s;bool s;bool? s;bool!]
- ["Can parse Nat syntax." +123 ast;nat number;Eq<Nat> s;nat s;nat? s;nat!]
- ["Can parse Int syntax." 123 ast;int number;Eq<Int> s;int s;int? s;int!]
- ## ["Can parse Frac syntax." .123 ast;frac number;Eq<Frac> s;frac s;frac? s;frac!]
- ["Can parse Real syntax." 123.0 ast;real number;Eq<Real> s;real s;real? s;real!]
- ["Can parse Char syntax." #"\n" ast;char char;Eq<Char> s;char s;char? s;char!]
- ["Can parse Text syntax." "\n" ast;text text;Eq<Text> s;text s;text? s;text!]
- ["Can parse Symbol syntax." ["yolo" "lol"] ast;symbol ident;Eq<Ident> s;symbol s;symbol? s;symbol!]
- ["Can parse Tag syntax." ["yolo" "lol"] ast;tag ident;Eq<Ident> s;tag s;tag? s;tag!]
+ ["Can parse Bool syntax." true ast;bool bool;Eq<Bool> s;bool]
+ ["Can parse Nat syntax." +123 ast;nat number;Eq<Nat> s;nat]
+ ["Can parse Int syntax." 123 ast;int number;Eq<Int> s;int]
+ ["Can parse Frac syntax." .123 ast;frac number;Eq<Frac> s;frac]
+ ["Can parse Real syntax." 123.0 ast;real number;Eq<Real> s;real]
+ ["Can parse Char syntax." #"\n" ast;char char;Eq<Char> s;char]
+ ["Can parse Text syntax." "\n" ast;text text;Eq<Text> s;text]
+ ["Can parse Symbol syntax." ["yolo" "lol"] ast;symbol ident;Eq<Ident> s;symbol]
+ ["Can parse Tag syntax." ["yolo" "lol"] ast;tag ident;Eq<Ident> s;tag]
)]
($_ seq
<simple-tests>
@@ -252,8 +252,8 @@
(assert "Can parse while taking separators into account."
(and (match (list 123 456 789)
(s;run (list (ast;int 123) (ast;text "YOLO") (ast;int 456) (ast;text "YOLO") (ast;int 789))
- (s;sep-by (s;text! "YOLO") s;int)))
+ (s;sep-by (s;sample! (' "YOLO")) s;int)))
(match (list 123 456)
(s;run (list (ast;int 123) (ast;text "YOLO") (ast;int 456) (ast;int 789))
- (s;sep-by (s;text! "YOLO") s;int)))))
+ (s;sep-by (s;sample! (' "YOLO")) s;int)))))
))