summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShmuel Zeigerman <solomuz0@gmail.com>2012-02-13 23:38:07 +0200
committerShmuel Zeigerman <solomuz0@gmail.com>2012-02-13 23:38:07 +0200
commite98c08314819bc5f609889087b329d0b78180d41 (patch)
tree1661e5542d7f85beab292966bc99611107ee225e /test
parent94b08ae226ca1e2ccb4c88ab51d2679b858d646e (diff)
downloadlrexlib-e98c08314819bc5f609889087b329d0b78180d41.tar.gz
TRE binding: add wide-character functions.
Diffstat (limited to 'test')
-rw-r--r--test/tre_sets.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/tre_sets.lua b/test/tre_sets.lua
index 89f00b6..e755e03 100644
--- a/test/tre_sets.lua
+++ b/test/tre_sets.lua
@@ -115,6 +115,21 @@ local function set_m_wexec (lib, flg)
}
end
+local function set_m_waexec (lib, flg)
+ return {
+ Name = "Method waexec",
+ Method = "waexec",
+ --{patt}, {subj, st} { results }
+ { {L".+"}, {L"abcd",{}}, {1,4,{}} }, -- [none]
+ { {L".+"}, {L"abcd",{},2}, {2,4,{}} }, -- positive st
+ { {L".+"}, {L"abcd",{},-2}, {3,4,{}} }, -- negative st
+ { {L".*"}, {L"abcd",{}}, {1,4,{}} }, -- [none]
+ { {L"bc"}, {L"abc", {}}, {2,3,{}} }, -- [none]
+ { {L "(.)b.(d)"}, {L"abcd",{}}, {1,4,{1,1,4,4}}},--[captures]
+ { {L"(a+)6+(b+)"}, {L"Taa66bbT",{},2}, {2,7,{2,3,6,7}}},--[st+captures]
+ }
+end
+
local function set_m_wtfind (lib, flg)
return {
Name = "Method wtfind",
@@ -129,6 +144,20 @@ local function set_m_wtfind (lib, flg)
}
end
+local function set_m_watfind (lib, flg)
+ return {
+ Name = "Method watfind",
+ Method = "watfind",
+ --{patt}, {subj, st} { results }
+ { {L".+"}, {L"abcd",{}}, {1,4,{}} }, -- [none]
+ { {L".+"}, {L"abcd",{},2}, {2,4,{}} }, -- positive st
+ { {L".+"}, {L"abcd",{},-2}, {3,4,{}} }, -- negative st
+ { {L".*"}, {L"abcd",{}}, {1,4,{}} }, -- [none]
+ { {L"bc"}, {L"abc", {}}, {2,3,{}} }, -- [none]
+ { {L"(.)b.(d)"}, {L"abcd",{}}, {1,4,{L"a",L"d"}}},--[captures]
+ }
+end
+
local function set_m_wfind (lib, flg)
return {
Name = "Method wfind",
@@ -308,7 +337,9 @@ return function (libname)
set_f_wfind (lib),
set_f_wmatch (lib),
set_m_wexec (lib),
+ set_m_waexec (lib),
set_m_wtfind (lib),
+ set_m_watfind (lib),
set_m_wfind (lib),
set_m_wmatch (lib),
set_f_wgsub1 (lib),