Skip to content

Commit bf74d23

Browse files
committed
fix(test): fix unused macro parameter
MATCH_ACCESS_SPECIFIER_ERROR's code_before parameter is unused. This happens to work because each call gave the same string to code_before. However, this is confusing. Fix the code to use the code_before parameter as intended.
1 parent d9b69b1 commit bf74d23

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/test-parse-typescript-class.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -919,17 +919,17 @@ TEST_F(test_parse_typescript_class,
919919
}
920920

921921
for (string8 specifier : {u8"public", u8"protected", u8"private"}) {
922-
#define MATCH_ACCESS_SPECIFIER_ERROR(code_before) \
923-
::testing::AnyOf( \
924-
DIAG_TYPE_OFFSETS(p.code, \
925-
diag_typescript_private_not_allowed_in_javascript, \
926-
specifier, strlen(u8"class C { "), u8"private"_sv), \
927-
DIAG_TYPE_OFFSETS(p.code, \
928-
diag_typescript_protected_not_allowed_in_javascript, \
929-
specifier, strlen(u8"class C { "), u8"protected"_sv), \
930-
DIAG_TYPE_OFFSETS(p.code, \
931-
diag_typescript_public_not_allowed_in_javascript, \
932-
specifier, strlen(u8"class C { "), u8"public"_sv))
922+
#define MATCH_ACCESS_SPECIFIER_ERROR(code_before) \
923+
::testing::AnyOf( \
924+
DIAG_TYPE_OFFSETS(p.code, \
925+
diag_typescript_private_not_allowed_in_javascript, \
926+
specifier, strlen(code_before), u8"private"_sv), \
927+
DIAG_TYPE_OFFSETS(p.code, \
928+
diag_typescript_protected_not_allowed_in_javascript, \
929+
specifier, strlen(code_before), u8"protected"_sv), \
930+
DIAG_TYPE_OFFSETS(p.code, \
931+
diag_typescript_public_not_allowed_in_javascript, \
932+
specifier, strlen(code_before), u8"public"_sv))
933933

934934
{
935935
test_parser p(

0 commit comments

Comments
 (0)