Skip to content

Commit 56bdadb

Browse files
committed
refactor(test): remove last use of DIAG_TYPE_2_OFFSETS
#1154
1 parent 262ad6c commit 56bdadb

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

test/test-parse-typescript-function-overload.cpp

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -350,40 +350,14 @@ TEST_F(Test_Parse_TypeScript_Function_Overload,
350350
}
351351

352352
{
353-
Test_Parser p(
354-
u8"function f();\n"_sv
355-
u8"function f();\n"_sv
356-
u8"function f();\n"_sv
357-
u8"function g();\n"_sv
358-
u8"function f();\n"_sv
359-
u8"function f();\n"_sv
360-
u8"function f() {}"_sv,
361-
typescript_options, capture_diags);
362-
p.parse_and_visit_module();
353+
Spy_Visitor p = test_parse_and_visit_module(
354+
u8"function f();\nfunction f();\nfunction f();\nfunction g();\nfunction f();\nfunction f();\nfunction f() {}"_sv, //
355+
u8" ^ Diag_TypeScript_Function_Overload_Signature_Must_Have_Same_Name.function_name\n"_diag //
356+
u8" ^ .overload_name"_diag,
357+
typescript_options);
363358
EXPECT_THAT(
364359
p.variable_declarations,
365360
ElementsAreArray({function_decl(u8"g"_sv), function_decl(u8"f"_sv)}));
366-
EXPECT_THAT(
367-
p.legacy_errors(),
368-
ElementsAreArray({
369-
DIAG_TYPE_2_OFFSETS(
370-
p.code,
371-
Diag_TypeScript_Function_Overload_Signature_Must_Have_Same_Name,
372-
overload_name,
373-
u8"function f();\n"
374-
u8"function f();\n"
375-
u8"function f();\n"
376-
u8"function "_sv.size(),
377-
u8"g"_sv, function_name,
378-
u8"function f();\n"
379-
u8"function f();\n"
380-
u8"function f();\n"
381-
u8"function g();\n"
382-
u8"function f();\n"
383-
u8"function f();\n"
384-
u8"function "_sv.size(),
385-
u8"g"_sv),
386-
}));
387361
}
388362

389363
{

0 commit comments

Comments
 (0)