Skip to content

Commit d9b69b1

Browse files
committed
refactor: always use u8""_sv instead of u8""sv
u8""_sv is under our control, so use that instead of the standard's u8""sv.
1 parent e138d8c commit d9b69b1

8 files changed

+139
-139
lines changed

test/test-lex.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ TEST_F(test_lex, fail_lex_integer_loses_precision) {
391391
diag_integer_literal_will_lose_precision, //
392392
characters,
393393
offsets_matcher(input, 0, u8"9007199254740993"_sv), //
394-
rounded_val, u8"9007199254740992"sv),
394+
rounded_val, u8"9007199254740992"_sv),
395395
}));
396396
});
397397
this->check_tokens(u8"999999999999999"_sv, {token_type::number});
@@ -408,7 +408,7 @@ TEST_F(test_lex, fail_lex_integer_loses_precision) {
408408
characters,
409409
offsets_matcher(input, 0,
410410
310), //
411-
rounded_val, u8"inf"sv),
411+
rounded_val, u8"inf"_sv),
412412
}));
413413
});
414414
this->check_tokens_with_errors(
@@ -423,7 +423,7 @@ TEST_F(test_lex, fail_lex_integer_loses_precision) {
423423
offsets_matcher(input, 0,
424424
309), //
425425
rounded_val,
426-
u8"179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368"sv),
426+
u8"179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368"_sv),
427427
}));
428428
});
429429
this->check_tokens_with_errors(
@@ -436,7 +436,7 @@ TEST_F(test_lex, fail_lex_integer_loses_precision) {
436436
characters,
437437
offsets_matcher(input, 0,
438438
309), //
439-
rounded_val, u8"inf"sv),
439+
rounded_val, u8"inf"_sv),
440440
}));
441441
});
442442
this->check_tokens_with_errors(
@@ -449,7 +449,7 @@ TEST_F(test_lex, fail_lex_integer_loses_precision) {
449449
diag_integer_literal_will_lose_precision, //
450450
characters,
451451
offsets_matcher(input, 0, u8"18014398509481986"_sv), //
452-
rounded_val, u8"18014398509481984"sv),
452+
rounded_val, u8"18014398509481984"_sv),
453453
}));
454454
});
455455
}
@@ -3360,7 +3360,7 @@ TEST_F(test_lex, jsx_string) {
33603360
// https://github.com/facebook/jsx/pull/133
33613361
TEST_F(test_lex, jsx_string_ignores_comments) {
33623362
{
3363-
padded_string code(u8"! 'hello // '\nworld'"sv);
3363+
padded_string code(u8"! 'hello // '\nworld'"_sv);
33643364
diag_collector errors;
33653365
lexer l(&code, &errors);
33663366
l.skip_in_jsx(); // Ignore '!'.
@@ -3378,7 +3378,7 @@ TEST_F(test_lex, jsx_string_ignores_comments) {
33783378
}
33793379

33803380
{
3381-
padded_string code(u8R"(! "hello/* not"comment */world")"sv);
3381+
padded_string code(u8R"(! "hello/* not"comment */world")"_sv);
33823382
diag_collector errors;
33833383
lexer l(&code, &errors);
33843384
l.skip_in_jsx(); // Ignore '!'.
@@ -3397,7 +3397,7 @@ TEST_F(test_lex, jsx_string_ignores_comments) {
33973397
}
33983398

33993399
TEST_F(test_lex, unterminated_jsx_string) {
3400-
padded_string code(u8"! 'hello"sv);
3400+
padded_string code(u8"! 'hello"_sv);
34013401
diag_collector errors;
34023402
lexer l(&code, &errors);
34033403
l.skip_in_jsx(); // Ignore '!'.
@@ -3423,14 +3423,14 @@ TEST_F(test_lex, jsx_tag) {
34233423
l.skip_in_jsx(); // Ignore '<'.
34243424

34253425
EXPECT_EQ(l.peek().type, token_type::identifier);
3426-
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"svg"sv);
3426+
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"svg"_sv);
34273427

34283428
l.skip_in_jsx();
34293429
EXPECT_EQ(l.peek().type, token_type::colon);
34303430

34313431
l.skip_in_jsx();
34323432
EXPECT_EQ(l.peek().type, token_type::identifier);
3433-
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"rect"sv);
3433+
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"rect"_sv);
34343434

34353435
EXPECT_THAT(errors.errors, IsEmpty());
34363436
}
@@ -3442,14 +3442,14 @@ TEST_F(test_lex, jsx_tag) {
34423442
l.skip_in_jsx(); // Ignore '<'.
34433443

34443444
EXPECT_EQ(l.peek().type, token_type::identifier);
3445-
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"myModule"sv);
3445+
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"myModule"_sv);
34463446

34473447
l.skip_in_jsx();
34483448
EXPECT_EQ(l.peek().type, token_type::dot);
34493449

34503450
l.skip_in_jsx();
34513451
EXPECT_EQ(l.peek().type, token_type::identifier);
3452-
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"MyComponent"sv);
3452+
EXPECT_EQ(l.peek().identifier_name().normalized_name(), u8"MyComponent"_sv);
34533453

34543454
EXPECT_THAT(errors.errors, IsEmpty());
34553455
}

0 commit comments

Comments
 (0)