Skip to content

Commit e25ca10

Browse files
jnthntatumcopybara-github
authored andcommitted
std::string_view->absl::string_view
PiperOrigin-RevId: 954987806
1 parent 21620e2 commit e25ca10

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

parser/internal/pratt_parser_test.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ std::string TestName(const testing::TestParamInfo<T>& test_info) {
6767
}
6868

6969
absl::StatusOr<std::unique_ptr<cel::Ast>> Parse(
70-
std::string_view expression,
70+
absl::string_view expression,
7171
const cel::ParserOptions& options = cel::ParserOptions(),
7272
std::vector<cel::ParseIssue>* issues = nullptr) {
7373
#if USE_PRATT_PARSER
@@ -82,15 +82,15 @@ absl::StatusOr<std::unique_ptr<cel::Ast>> Parse(
8282
}
8383

8484
struct TestCase {
85-
std::string_view source;
86-
std::string_view expected_ast;
85+
absl::string_view source;
86+
absl::string_view expected_ast;
8787
bool enable_optional_syntax = false;
8888
bool enable_variadic_logical_operators = false;
8989
};
9090

9191
class PrattParserTest : public testing::TestWithParam<TestCase> {};
9292

93-
std::string_view ConstantKind(const cel::Constant& c) {
93+
absl::string_view ConstantKind(const cel::Constant& c) {
9494
switch (c.kind_case()) {
9595
case ConstantKindCase::kBool:
9696
return "bool";
@@ -111,7 +111,7 @@ std::string_view ConstantKind(const cel::Constant& c) {
111111
}
112112
}
113113

114-
std::string_view ExprKind(const cel::Expr& e) {
114+
absl::string_view ExprKind(const cel::Expr& e) {
115115
switch (e.kind_case()) {
116116
case ExprKindCase::kConstant:
117117
// special cased, this doesn't appear.
@@ -155,12 +155,12 @@ class KindAndIdAdorner : public cel::test::ExpressionAdorner {
155155
}
156156
};
157157

158-
std::string Unindent(std::string_view multiline) {
158+
std::string Unindent(absl::string_view multiline) {
159159
std::vector<std::string> unindented_lines;
160160
int indent = -1;
161-
for (std::string_view line : absl::StrSplit(multiline, '\n')) {
161+
for (absl::string_view line : absl::StrSplit(multiline, '\n')) {
162162
std::size_t pos = line.find_first_not_of(" \t");
163-
if (pos == std::string_view::npos) continue;
163+
if (pos == absl::string_view::npos) continue;
164164
if (indent == -1) indent = pos;
165165
unindented_lines.push_back(std::string(line.substr(indent)));
166166
}
@@ -1095,8 +1095,8 @@ INSTANTIATE_TEST_SUITE_P(PrattParserTest, PrattParserTest,
10951095
TestName<TestCase>);
10961096

10971097
struct ErrorTestCase {
1098-
std::string_view source;
1099-
std::string_view expected_error;
1098+
absl::string_view source;
1099+
absl::string_view expected_error;
11001100
bool enable_optional_syntax = false;
11011101
bool enable_quoted_identifiers = false;
11021102
};
@@ -1505,8 +1505,8 @@ TEST(ParserWorkerTest, GetTokenTextBoundsChecking) {
15051505
}
15061506

15071507
struct MacroTestCase {
1508-
std::string_view source;
1509-
std::string_view expected_ast;
1508+
absl::string_view source;
1509+
absl::string_view expected_ast;
15101510
};
15111511

15121512
class PrattParserMacroTest : public testing::TestWithParam<MacroTestCase> {};

0 commit comments

Comments
 (0)