/[pcre]/code/trunk/pcrecpp_unittest.cc
ViewVC logotype

Diff of /code/trunk/pcrecpp_unittest.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 262 by ph10, Wed Sep 19 09:11:19 2007 UTC revision 263 by ph10, Mon Nov 12 16:53:25 2007 UTC
# Line 857  int main(int argc, char** argv) { Line 857  int main(int argc, char** argv) {
857    CHECK_EQ(s, string("ruby"));    CHECK_EQ(s, string("ruby"));
858    CHECK_EQ(i, 1234);    CHECK_EQ(i, 1234);
859    
860      // Ignore non-void* NULL arg
861      CHECK(RE("he(.*)lo").FullMatch("hello", (char*)NULL));
862      CHECK(RE("h(.*)o").FullMatch("hello", (string*)NULL));
863      CHECK(RE("h(.*)o").FullMatch("hello", (StringPiece*)NULL));
864      CHECK(RE("(.*)").FullMatch("1234", (int*)NULL));
865      CHECK(RE("(.*)").FullMatch("1234567890123456", (long long*)NULL));
866      CHECK(RE("(.*)").FullMatch("123.4567890123456", (double*)NULL));
867      CHECK(RE("(.*)").FullMatch("123.4567890123456", (float*)NULL));
868    
869      // Fail on non-void* NULL arg if the match doesn't parse for the given type.
870      CHECK(!RE("h(.*)lo").FullMatch("hello", &s, (char*)NULL));
871      CHECK(!RE("(.*)").FullMatch("hello", (int*)NULL));
872      CHECK(!RE("(.*)").FullMatch("1234567890123456", (int*)NULL));
873      CHECK(!RE("(.*)").FullMatch("hello", (double*)NULL));
874      CHECK(!RE("(.*)").FullMatch("hello", (float*)NULL));
875    
876    // Ignored arg    // Ignored arg
877    CHECK(RE("(\\w+)(:)(\\d+)").FullMatch("ruby:1234", &s, (void*)NULL, &i));    CHECK(RE("(\\w+)(:)(\\d+)").FullMatch("ruby:1234", &s, (void*)NULL, &i));
878    CHECK_EQ(s, string("ruby"));    CHECK_EQ(s, string("ruby"));

Legend:
Removed from v.262  
changed lines
  Added in v.263

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12