mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-03 02:10:53 +01:00
update test
This commit is contained in:
parent
55895a006e
commit
414d6a4b97
1 changed files with 13 additions and 11 deletions
|
@ -492,11 +492,7 @@ TEST_CASE_FIXTURE(Fixture, "class_definition_indexer")
|
|||
|
||||
TEST_CASE_FIXTURE(Fixture, "class_definitions_reference_other_classes")
|
||||
{
|
||||
unfreeze(frontend.globals.globalTypes);
|
||||
LoadDefinitionFileResult result = frontend.loadDefinitionFile(
|
||||
frontend.globals,
|
||||
frontend.globals.globalScope,
|
||||
R"(
|
||||
loadDefinition(R"(
|
||||
declare class Channel
|
||||
Messages: { Message }
|
||||
OnMessage: (message: Message) -> ()
|
||||
|
@ -506,13 +502,19 @@ TEST_CASE_FIXTURE(Fixture, "class_definitions_reference_other_classes")
|
|||
Text: string
|
||||
Channel: Channel
|
||||
end
|
||||
)",
|
||||
"@test",
|
||||
/* captureComments */ false
|
||||
);
|
||||
freeze(frontend.globals.globalTypes);
|
||||
)");
|
||||
|
||||
REQUIRE(result.success);
|
||||
CheckResult result = check(R"(
|
||||
local a: Channel
|
||||
local b = a.Messages[1]
|
||||
local c = b.Channel
|
||||
)");
|
||||
|
||||
LUAU_REQUIRE_NO_ERRORS(result);
|
||||
|
||||
CHECK_EQ(toString(requireType("a")), "Channel");
|
||||
CHECK_EQ(toString(requireType("b")), "Message");
|
||||
CHECK_EQ(toString(requireType("c")), "Channel");
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(Fixture, "definition_file_has_source_module_name_set")
|
||||
|
|
Loading…
Add table
Reference in a new issue