diff options
author | Sergio Queiroz <sqmedeiros@gmail.com> | 2016-11-29 18:06:10 -0300 |
---|---|---|
committer | Sergio Queiroz <sqmedeiros@gmail.com> | 2016-11-29 18:06:10 -0300 |
commit | e7e17699870f0bd6ba43b4e946297fb581d28b48 (patch) | |
tree | 36d938b8d93c916ee47548d78d0acd19fe296658 /testlabel.lua | |
parent | 3a5f5683bf6d676ea4118c3a8d0fc25de317d91f (diff) | |
download | lpeglabel-e7e17699870f0bd6ba43b4e946297fb581d28b48.tar.gz lpeglabel-e7e17699870f0bd6ba43b4e946297fb581d28b48.tar.bz2 lpeglabel-e7e17699870f0bd6ba43b4e946297fb581d28b48.zip |
Updating examples
Diffstat (limited to 'testlabel.lua')
-rw-r--r-- | testlabel.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testlabel.lua b/testlabel.lua index cb92657..d9bac64 100644 --- a/testlabel.lua +++ b/testlabel.lua | |||
@@ -173,6 +173,15 @@ p = m.Rec(#m.T(22), m.P"a", 22) | |||
173 | r, l, serror = p:match("bbc") | 173 | r, l, serror = p:match("bbc") |
174 | assert(r == nil and l == 0 and serror == "bbc") | 174 | assert(r == nil and l == 0 and serror == "bbc") |
175 | 175 | ||
176 | p = m.Rec(#m.P("a") * m.T(22), m.T(15), 22) | ||
177 | r, l, serror = p:match("abc") | ||
178 | assert(r == nil and l == 15 and serror == "abc") | ||
179 | |||
180 | p = m.Rec(#(m.P("a") * m.T(22)), m.T(15), 22) | ||
181 | r, l, serror = p:match("abc") | ||
182 | assert(r == nil and l == 15 and serror == "bc") | ||
183 | |||
184 | |||
176 | 185 | ||
177 | -- tests related to repetition | 186 | -- tests related to repetition |
178 | p = m.T(1)^0 | 187 | p = m.T(1)^0 |