From 9abad258c3e6a6625542bd07d2581816c19d479f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 17 Feb 2021 13:29:30 -0800 Subject: [PATCH] Expand tests for unicode property escapes --- .../test_grammars/unicode_classes/corpus.txt | 33 ++++++++++++++++--- .../unicode_classes/grammar.json | 17 ++++++---- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/test/fixtures/test_grammars/unicode_classes/corpus.txt b/test/fixtures/test_grammars/unicode_classes/corpus.txt index d1e09e3b..d28d1acb 100644 --- a/test/fixtures/test_grammars/unicode_classes/corpus.txt +++ b/test/fixtures/test_grammars/unicode_classes/corpus.txt @@ -1,9 +1,32 @@ -============================ -Letters -====================== +=============== +Uppercase words +=============== -Aბㄱ +Δბㄱ Ψ Ɓƀ Ƒ Ɣ Śřř --- -(expression (upper)) +(program + (upper) (upper) (upper) (upper) (upper) (upper)) + +================ +Lowercase words +================ + +śś ťť ßß + +--- + +(program + (lower) (lower) (lower)) + +================ +Math symbols +================ + +≺ ≼ ≠ ≝ ⨔∑ + +--- + +(program + (math_sym) (math_sym) (math_sym) (math_sym) (math_sym)) diff --git a/test/fixtures/test_grammars/unicode_classes/grammar.json b/test/fixtures/test_grammars/unicode_classes/grammar.json index ebbe7f3a..9b040867 100644 --- a/test/fixtures/test_grammars/unicode_classes/grammar.json +++ b/test/fixtures/test_grammars/unicode_classes/grammar.json @@ -6,13 +6,16 @@ ], "rules": { - "expression": { - "type": "CHOICE", - "members": [ - {"type": "SYMBOL", "name": "lower"}, - {"type": "SYMBOL", "name": "upper"}, - {"type": "SYMBOL", "name": "math_sym"} - ] + "program": { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + {"type": "SYMBOL", "name": "lower"}, + {"type": "SYMBOL", "name": "upper"}, + {"type": "SYMBOL", "name": "math_sym"} + ] + } }, "lower": {