mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add test case
This commit is contained in:
parent
d6aa35583e
commit
eeaea33c4d
1 changed files with 17 additions and 0 deletions
|
@ -362,4 +362,21 @@ TEST_CASE_FIXTURE(Fixture, "class_definition_overload_metamethods")
|
||||||
CHECK_EQ(toString(requireType("shouldBeVector")), "Vector3");
|
CHECK_EQ(toString(requireType("shouldBeVector")), "Vector3");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE_FIXTURE(Fixture, "class_definition_string_props")
|
||||||
|
{
|
||||||
|
loadDefinition(R"(
|
||||||
|
declare class Foo
|
||||||
|
["a property"]: string
|
||||||
|
end
|
||||||
|
)");
|
||||||
|
|
||||||
|
CheckResult result = check(R"(
|
||||||
|
local x: Foo
|
||||||
|
local y = x["a property"]
|
||||||
|
)");
|
||||||
|
|
||||||
|
LUAU_REQUIRE_NO_ERRORS(result);
|
||||||
|
CHECK_EQ(toString(requireType("y")), "string");
|
||||||
|
}
|
||||||
|
|
||||||
TEST_SUITE_END();
|
TEST_SUITE_END();
|
||||||
|
|
Loading…
Add table
Reference in a new issue