grpc
third_party
re2
re2
testing
re2/re2/testing/exhaustive_test.cc
Go to the documentation of this file.
1
// Copyright 2008 The RE2 Authors. All Rights Reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
5
// Exhaustive testing of regular expression matching.
6
7
#include "util/test.h"
8
#include "re2/testing/exhaustive_tester.h"
9
10
namespace
re2
{
11
12
// Test very simple expressions.
13
TEST
(EgrepLiterals, Lowercase) {
14
EgrepTest
(3, 2,
"abc."
, 3,
"abc"
,
""
);
15
}
16
17
// Test mixed-case expressions.
18
TEST
(EgrepLiterals, MixedCase) {
19
EgrepTest
(3, 2,
"AaBb."
, 2,
"AaBb"
,
""
);
20
}
21
22
// Test mixed-case in case-insensitive mode.
23
TEST
(EgrepLiterals, FoldCase) {
24
// The punctuation characters surround A-Z and a-z
25
// in the ASCII table. This looks for bugs in the
26
// bytemap range code in the DFA.
27
EgrepTest
(3, 2,
"abAB."
, 2,
"aBc@_~"
,
"(?i:%s)"
);
28
}
29
30
// Test very simple expressions.
31
TEST
(EgrepLiterals,
UTF8
) {
32
EgrepTest
(3, 2,
"ab."
, 4,
"a\xE2\x98\xBA"
,
""
);
33
}
34
35
}
// namespace re2
36
re2
Definition:
bloaty/third_party/re2/re2/bitmap256.h:17
re2::UTF8
static std::string UTF8(Rune r)
Definition:
bloaty/third_party/re2/re2/testing/exhaustive3_test.cc:35
re2::EgrepTest
void EgrepTest(int maxatoms, int maxops, const std::string &alphabet, int maxstrlen, const std::string &stralphabet, const std::string &wrapper)
Definition:
bloaty/third_party/re2/re2/testing/exhaustive_tester.cc:172
re2::TEST
TEST(TestCharClassBuilder, Adds)
Definition:
bloaty/third_party/re2/re2/testing/charclass_test.cc:198
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:20