[pattern] Fix regex nth callback, activate env-set pattern range tests
This commit is contained in:
parent
97d6300c62
commit
67fcc00125
|
@ -334,7 +334,7 @@ void li_pattern_regex_cb(GString *pattern_result, guint from, guint to, gpointer
|
|||
}
|
||||
} else {
|
||||
from = MIN(from, G_MAXINT); /* => from+1 is defined */
|
||||
for (i = from + 1; i-- >= to; ) {
|
||||
for (i = from + 1; --i >= to; ) {
|
||||
if (g_match_info_fetch_pos(match_info, (gint) i, &start_pos, &end_pos)) {
|
||||
g_string_append_len(pattern_result, g_match_info_get_string(match_info) + start_pos, end_pos - start_pos);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ if req.path =~ "(.*)" {
|
|||
URL = "/path/?a_simple_query"
|
||||
EXPECT_RESPONSE_BODY = "/path/"
|
||||
EXPECT_RESPONSE_CODE = 200
|
||||
todo = True
|
||||
|
||||
class TestPatternCaptureRange(CurlRequest):
|
||||
# use capture from previous regex conditional
|
||||
|
@ -27,7 +26,6 @@ if req.path =~ "/([^/]*)/(.*)" {
|
|||
URL = "/path/xyz"
|
||||
EXPECT_RESPONSE_BODY = "pathxyz"
|
||||
EXPECT_RESPONSE_CODE = 200
|
||||
todo = True
|
||||
|
||||
class TestPatternCaptureRevRange(CurlRequest):
|
||||
# use capture from previous regex conditional
|
||||
|
@ -40,7 +38,6 @@ if req.path =~ "/([^/]*)/(.*)" {
|
|||
URL = "/path/xyz"
|
||||
EXPECT_RESPONSE_BODY = "xyzpath"
|
||||
EXPECT_RESPONSE_CODE = 200
|
||||
todo = True
|
||||
|
||||
class TestPatternEncodingPath(CurlRequest):
|
||||
# encoding path
|
||||
|
@ -77,6 +74,8 @@ show_env_info;
|
|||
class Test(GroupTest):
|
||||
group = [
|
||||
TestPatternCapture,
|
||||
TestPatternCaptureRange,
|
||||
TestPatternCaptureRevRange,
|
||||
TestPatternEncodingPath,
|
||||
TestPatternCombine,
|
||||
TestPatternEscape,
|
||||
|
|
Loading…
Reference in New Issue