Lines Matching refs:CHECK

54 // CHECK dies with a fatal error if condition is not true.  It is *not*
58 #define CHECK(condition) do { \
66 #define CHECK_EQ(a, b) CHECK(a == b)
73 CHECK(pattern.FullMatch(p));
82 CHECK(pattern.FullMatch("ruby:1234", &i));
121 CHECK(growth < 0.02); // Allow < 2% growth
132 CHECK(RE("([0-9a-fA-F]+)[uUlL]*").FullMatch(#value, Hex(&v))); \
134 CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0x" #value, CRadix(&v))); \
158 CHECK(RE("([0-7]+)[uUlL]*").FullMatch(#value, Octal(&v))); \
160 CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0" #value, CRadix(&v))); \
184 CHECK(RE("(-?[0-9]+)[uUlL]*").FullMatch(#value, &v)); \
186 CHECK(RE("(-?[0-9a-fA-FxX]+)[uUlL]*").FullMatch(#value, CRadix(&v))); \
338 CHECK(re.Replace(t->rewrite, &one));
370 CHECK(RE("(.*)@([^.]*)").Extract("\\2!\\1", "boris@kremvax.ru", &s));
374 CHECK(RE(".*").Extract("'\\0'", "foo", &s));
376 CHECK(!RE("bar").Extract("'\\0'", "baz", &s));
389 CHECK(r.Consume(&input, &word));
391 CHECK(r.Consume(&input, &word));
393 CHECK(! r.Consume(&input, &word));
405 CHECK(r.FindAndConsume(&input, &word));
407 CHECK(r.FindAndConsume(&input, &word));
409 CHECK(r.FindAndConsume(&input, &word));
411 CHECK(! r.FindAndConsume(&input, &word));
422 CHECK(r.PartialMatch("foo", &word1, &word2, &word3));
426 CHECK(r.PartialMatch("bar", &word1, &word2, &word3));
430 CHECK(r.PartialMatch("baz", &word1, &word2, &word3));
434 CHECK(!r.PartialMatch("f", &word1, &word2, &word3));
437 CHECK(RE("(foo)|hello").FullMatch("hello", &a));
455 CHECK(re.PartialMatch(text_good) == true);
456 CHECK(re.PartialMatch(text_bad) == false);
457 CHECK(re.FullMatch(text_good) == false);
458 CHECK(re.FullMatch(text_bad) == false);
462 CHECK(re2.PartialMatch(text_good) == false); // because of match_limit
463 CHECK(re2.PartialMatch(text_bad) == false);
464 CHECK(re2.FullMatch(text_good) == false);
465 CHECK(re2.FullMatch(text_bad) == false);
470 CHECK(re3.PartialMatch(text_good) == true);
471 CHECK(re3.PartialMatch(text_bad) == false);
472 CHECK(re3.FullMatch(text_good) == false);
473 CHECK(re3.FullMatch(text_bad) == false);
477 CHECK(re4.PartialMatch(text_good) == false);
478 CHECK(re4.PartialMatch(text_bad) == false);
479 CHECK(re4.FullMatch(text_good) == false);
480 CHECK(re4.FullMatch(text_bad) == false);
488 CHECK(re.FullMatch(unquoted));
497 CHECK(!re.FullMatch(should_not_match));
601 CHECK(RE(regex,options).FullMatch(str));
603 CHECK(RE(regex,options).PartialMatch(str));
606 CHECK(!RE(regex,options).FullMatch(str));
608 CHECK(!RE(regex,options).PartialMatch(str));
713 CHECK(re.Extract("\\1", str , &captured));
788 CHECK(orig.FullMatch(str));
791 CHECK(copy1.FullMatch(str));
794 CHECK(!copy2.FullMatch(str));
796 CHECK(copy2.FullMatch(str));
798 CHECK(copy2.FullMatch(str));
804 CHECK(orig.FullMatch(str));
805 CHECK(copy1.FullMatch(str));
806 CHECK(copy2.FullMatch(str));
842 CHECK(RE("h.*o").FullMatch("hello"));
843 CHECK(!RE("h.*o").FullMatch("othello")); // Must be anchored at front
844 CHECK(!RE("h.*o").FullMatch("hello!")); // Must be anchored at end
845 CHECK(RE("a*").FullMatch("aaaa")); // Fullmatch with normal op
846 CHECK(RE("a*?").FullMatch("aaaa")); // Fullmatch with nongreedy op
847 CHECK(RE("a*?\\z").FullMatch("aaaa")); // Two unusual ops
852 CHECK(RE("\\d+").FullMatch("1001"));
855 CHECK(RE("(\\d+)").FullMatch("1001", &i));
857 CHECK(RE("(-?\\d+)").FullMatch("-123", &i));
859 CHECK(!RE("()\\d+").FullMatch("10", &i));
860 CHECK(!RE("(\\d+)").FullMatch("1234567890123456789012345678901234567890",
864 CHECK(RE("1(\\d*)4").FullMatch("1234", &i));
866 CHECK(RE("(\\d)\\d+").FullMatch("1234", &i));
868 CHECK(RE("(-\\d)\\d+").FullMatch("-1234", &i));
870 CHECK(RE("(\\d)").PartialMatch("1234", &i));
872 CHECK(RE("(-\\d)").PartialMatch("-1234", &i));
876 CHECK(RE("h(.*)o").FullMatch("hello", &s));
881 CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &sp, &i));
883 CHECK(memcmp(sp.data(), "ruby", 4) == 0);
887 CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &s, &i));
892 CHECK(RE("he(.*)lo").FullMatch("hello", (char*)NULL));
893 CHECK(RE("h(.*)o").FullMatch("hello", (string*)NULL));
894 CHECK(RE("h(.*)o").FullMatch("hello", (StringPiece*)NULL));
895 CHECK(RE("(.*)").FullMatch("1234", (int*)NULL));
897 CHECK(RE("(.*)").FullMatch("1234567890123456", (long long*)NULL));
899 CHECK(RE("(.*)").FullMatch("123.4567890123456", (double*)NULL));
900 CHECK(RE("(.*)").FullMatch("123.4567890123456", (float*)NULL));
903 CHECK(!RE("h(.*)lo").FullMatch("hello", &s, (char*)NULL));
904 CHECK(!RE("(.*)").FullMatch("hello", (int*)NULL));
905 CHECK(!RE("(.*)").FullMatch("1234567890123456", (int*)NULL));
906 CHECK(!RE("(.*)").FullMatch("hello", (double*)NULL));
907 CHECK(!RE("(.*)").FullMatch("hello", (float*)NULL));
910 CHECK(RE("(\\w+)(:)(\\d+)").FullMatch("ruby:1234", &s, (void*)NULL, &i));
917 CHECK(RE("(H)ello").FullMatch("Hello", &c));
922 CHECK(RE("(H)ello").FullMatch("Hello", &c));
927 CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
928 CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100);
929 CHECK(RE("(-?\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767);
930 CHECK(RE("(-?\\d+)").FullMatch("-32768", &v)); CHECK_EQ(v, -32768);
931 CHECK(!RE("(-?\\d+)").FullMatch("-32769", &v));
932 CHECK(!RE("(-?\\d+)").FullMatch("32768", &v));
936 CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
937 CHECK(RE("(\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767);
938 CHECK(RE("(\\d+)").FullMatch("65535", &v)); CHECK_EQ(v, 65535);
939 CHECK(!RE("(\\d+)").FullMatch("65536", &v));
945 CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
946 CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100);
947 CHECK(RE("(-?\\d+)").FullMatch("2147483647", &v)); CHECK_EQ(v, max_value);
948 CHECK(RE("(-?\\d+)").FullMatch("-2147483648", &v)); CHECK_EQ(v, min_value);
949 CHECK(!RE("(-?\\d+)").FullMatch("-2147483649", &v));
950 CHECK(!RE("(-?\\d+)").FullMatch("2147483648", &v));
955 CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
956 CHECK(RE("(\\d+)").FullMatch("4294967295", &v)); CHECK_EQ(v, max_value);
957 CHECK(!RE("(\\d+)").FullMatch("4294967296", &v));
973 CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
974 CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100);
977 CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);
980 CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);
985 CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));
990 CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));
1000 CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100);
1001 CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100);
1004 CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);
1008 CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));
1013 CHECK(RE("(.*)").FullMatch("100", &v));
1014 CHECK(RE("(.*)").FullMatch("-100.", &v));
1015 CHECK(RE("(.*)").FullMatch("1e23", &v));
1019 CHECK(RE("(.*)").FullMatch("100", &v));
1020 CHECK(RE("(.*)").FullMatch("-100.", &v));
1021 CHECK(RE("(.*)").FullMatch("1e23", &v));
1025 CHECK(!RE("(\\d+)").FullMatch("x1001", &i));
1026 CHECK(!RE("(\\d+)").FullMatch("1001x", &i));
1027 CHECK(RE("x(\\d+)").FullMatch("x1001", &i)); CHECK_EQ(i, 1001);
1028 CHECK(RE("(\\d+)x").FullMatch("1001x", &i)); CHECK_EQ(i, 1001);
1031 CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcd"));
1032 CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcde"));
1033 CHECK(!RE("[0-9a-f+.-]{5,}").FullMatch("0abc"));
1036 CHECK(RE("foo|bar|[A-Z]").FullMatch("foo"));
1037 CHECK(RE("foo|bar|[A-Z]").FullMatch("bar"));
1038 CHECK(RE("foo|bar|[A-Z]").FullMatch("X"));
1039 CHECK(!RE("foo|bar|[A-Z]").FullMatch("XY"));
1042 CHECK(RE("fo|foo").FullMatch("fo"));
1043 CHECK(RE("fo|foo").FullMatch("foo"));
1044 CHECK(RE("fo|foo$").FullMatch("fo"));
1045 CHECK(RE("fo|foo$").FullMatch("foo"));
1046 CHECK(RE("foo$").FullMatch("foo"));
1047 CHECK(!RE("foo\\$").FullMatch("foo$bar"));
1048 CHECK(!RE("fo|bar").FullMatch("fox"));
1055 CHECK(!RE("foo$").PartialMatch("foo\n"));
1060 CHECK(RE("").FullMatch(""));
1063 CHECK(RE("(\\d){1}").FullMatch("1",
1068 CHECK(RE("(\\d)(\\d)").FullMatch("12",
1074 CHECK(RE("(\\d)(\\d)(\\d)").FullMatch("123",
1081 CHECK(RE("(\\d)(\\d)(\\d)(\\d)").FullMatch("1234",
1089 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("12345",
1099 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("123456",
1110 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("1234567",
1122 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)"
1150 CHECK(RE("h.*o").PartialMatch("hello"));
1151 CHECK(RE("h.*o").PartialMatch("othello"));
1152 CHECK(RE("h.*o").PartialMatch("hello!"));
1153 CHECK(RE("((((((((((((((((((((x))))))))))))))))))))").PartialMatch("x"));
1175 CHECK(re.error().empty()); // Must have no error
1199 CHECK(re_test1.FullMatch(utf8_string));
1201 CHECK(re_test2.FullMatch(utf8_string));
1207 CHECK(re_test3.PartialMatch(utf8_string, &ss));
1210 CHECK(re_test4.PartialMatch(utf8_string, &ss));
1215 CHECK(re_test5.FullMatch(utf8_string));
1217 CHECK(re_test6.FullMatch(utf8_string));
1221 CHECK(!re_test7.FullMatch(utf8_string));
1223 CHECK(re_test8.FullMatch(utf8_string));
1235 CHECK(!match_sentence.FullMatch(target));
1236 CHECK(!match_sentence_re.FullMatch(target));
1245 CHECK(!match_sentence.FullMatch(target));
1246 CHECK(!match_sentence_re.FullMatch(target));
1252 { RE re("a\\1"); CHECK(!re.error().empty()); }
1255 CHECK(!re.error().empty());
1259 CHECK(!re.error().empty());
1263 CHECK(!re.error().empty());
1267 CHECK(!re.error().empty());
1271 CHECK(!re.error().empty());