From 5f3f27bc2c3ecadda635965085ab8a0585a1bf74 Mon Sep 17 00:00:00 2001 From: Alex Engelberg Date: Sun, 1 May 2016 18:50:06 -0700 Subject: [PATCH] Modify rep-test to account for repetition of a concatenation --- test/instaparse/abnf_test.clj | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/instaparse/abnf_test.clj b/test/instaparse/abnf_test.clj index 3d0055a..fc10a7e 100644 --- a/test/instaparse/abnf_test.clj +++ b/test/instaparse/abnf_test.clj @@ -101,25 +101,28 @@ to test the lookahead" (def reps "Testing the different kinds of repetitions" (parser - "S = A B C D E + "S = A B C D E FG A = *'a' B = 2*'b' C = *2'c' D = 2'd' - E = 2*4'e'" + E = 2*4'e' + FG = 2('f' 'g')" :input-format :abnf)) (deftest rep-test (are [x] (not (instance? instaparse.gll.Failure x)) - (reps "aabbccddee") - (reps "bbbbbbddeeee") - (reps "bbcddee"))) + (reps "aabbccddeefgfg") + (reps "bbbbbbddeeeefgfg") + (reps "bbcddeefgfg"))) (deftest rep-test-errors (are [x] (instance? instaparse.gll.Failure x) (reps "") - (reps "bccddee") - (reps "aaaabbbbcccddee"))) + (reps "bccddeefgfg") + (reps "aaaabbbbcccddeefgfg") + (reps "aabbccddeefg") + (reps "aabbccddeeffgg"))) (def regex-chars "Testing %d42-91. The boundary chars are \"*\" and \"[\", which normally aren't allowed in a regex."