aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2017-09-05 20:04:23 -0400
committerEduardo Julian2017-09-05 20:04:23 -0400
commit0550e3e263eb7e15b83756976a6cc2c5e18022a7 (patch)
treee829b6cde0adade146a4bd70df9df1d9293019f4 /new-luxc/test
parent223ce32a52276f9a85fdd7918a46b58b4223738c (diff)
- Added optional "char" syntax for nats.
Diffstat (limited to 'new-luxc/test')
-rw-r--r--new-luxc/test/test/luxc/parser.lux12
1 files changed, 12 insertions, 0 deletions
diff --git a/new-luxc/test/test/luxc/parser.lux b/new-luxc/test/test/luxc/parser.lux
index 4c1b65584..247850e2b 100644
--- a/new-luxc/test/test/luxc/parser.lux
+++ b/new-luxc/test/test/luxc/parser.lux
@@ -106,6 +106,18 @@
false)
))
+(context: "Nat special syntax."
+ [expected (|> r;nat (:: @ map (n.% +1_000)))]
+ (test "Can parse nat char syntax."
+ (case (&;parse [default-cursor
+ (format "#\"" (text;from-code expected) "\"")])
+ (#R;Success [_ [_ (#;Nat actual)]])
+ (n.= expected actual)
+
+ _
+ false)
+ ))
+
(def: comment-text^
(r;Random Text)
(let [char-gen (|> r;nat (r;filter (function [value]