summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2010-09-12 17:38:04 +0200
committerReuben Thomas <rrt@sc3d.org>2010-09-12 22:42:04 +0200
commit247b99d4e7f0ac1c7856d6f9b65cea1cf88ff898 (patch)
tree23cdc0deeca7998c22360103d3420835bbfd4cf5 /test
parentcfeb0ba81b624a15001da525ca902ba6e138c816 (diff)
downloadlrexlib-247b99d4e7f0ac1c7856d6f9b65cea1cf88ff898.tar.gz
Remove gnu_rex.setsyntax, reimplement syntax flags as compilation
flags, adding the per-feature flags (which is why we need them to be numbers, not strings, so they can be combined). Hence, remove the special “syn” argument from the constructors, and alter the tests accordingly. Improve the documentation of GNU regex in one or two places. Rename the “reverse” execution flag to “backward”, for clarity.
Diffstat (limited to 'test')
-rw-r--r--test/emacs_sets.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/emacs_sets.lua b/test/emacs_sets.lua
index 19f0a3b..fb2b024 100644
--- a/test/emacs_sets.lua
+++ b/test/emacs_sets.lua
@@ -12,7 +12,7 @@ local function set_f_gmatch (lib, flg)
-- gmatch (s, p, [cf], [ef])
local function test_gmatch (subj, patt)
local out, guard = {}, 10
- for a, b in lib.gmatch (subj, patt, nil, nil, nil, "EMACS") do
+ for a, b in lib.gmatch (subj, patt, flg.SYNTAX_EMACS, nil) do
table.insert (out, { norm(a), norm(b) })
guard = guard - 1
if guard == 0 then break end
@@ -31,7 +31,7 @@ local function set_f_split (lib, flg)
-- split (s, p, [cf], [ef])
local function test_split (subj, patt)
local out, guard = {}, 10
- for a, b, c in lib.split (subj, patt, nil, nil, nil, "EMACS") do
+ for a, b, c in lib.split (subj, patt, flg.SYNTAX_EMACS, nil) do
table.insert (out, { norm(a), norm(b), norm(c) })
guard = guard - 1
if guard == 0 then break end
@@ -48,8 +48,9 @@ end
return function (libname)
local lib = require (libname)
+ local flags = lib.flags ()
return {
- set_f_gmatch (lib),
- set_f_split (lib),
+ set_f_gmatch (lib, flags),
+ set_f_split (lib, flags),
}
end