Browse Source

[pattern] Fix regex nth callback, activate env-set pattern range tests

master
Stefan Bühler 11 years ago
parent
commit
67fcc00125
  1. 2
      src/main/pattern.c
  2. 5
      tests/t-env-set.py

2
src/main/pattern.c

@ -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);
}

5
tests/t-env-set.py

@ -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…
Cancel
Save