mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add test cases
This commit is contained in:
parent
54324867df
commit
1f8aa1e9f0
1 changed files with 35 additions and 0 deletions
|
@ -72,6 +72,41 @@ TEST_CASE_FIXTURE(DocumentationSymbolFixture, "overloaded_fn")
|
|||
CHECK_EQ(symbol, "@test/global/foo/overload/(string) -> number");
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(DocumentationSymbolFixture, "class_method")
|
||||
{
|
||||
loadDefinition(R"(
|
||||
declare class Foo
|
||||
function bar(self, x: string): number
|
||||
end
|
||||
)");
|
||||
|
||||
std::optional<DocumentationSymbol> symbol = getDocSymbol(R"(
|
||||
local x: Foo
|
||||
x:bar("asdf")
|
||||
)",
|
||||
Position(2, 11));
|
||||
|
||||
CHECK_EQ(symbol, "@test/globaltype/Foo.bar");
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(DocumentationSymbolFixture, "overloaded_class_method")
|
||||
{
|
||||
loadDefinition(R"(
|
||||
declare class Foo
|
||||
function bar(self, x: string): number
|
||||
function bar(self, x: number): string
|
||||
end
|
||||
)");
|
||||
|
||||
std::optional<DocumentationSymbol> symbol = getDocSymbol(R"(
|
||||
local x: Foo
|
||||
x:bar("asdf")
|
||||
)",
|
||||
Position(2, 11));
|
||||
|
||||
CHECK_EQ(symbol, "@test/globaltype/Foo.bar/overload/(Foo, string) -> number");
|
||||
}
|
||||
|
||||
TEST_SUITE_END();
|
||||
|
||||
TEST_SUITE_BEGIN("AstQuery");
|
||||
|
|
Loading…
Add table
Reference in a new issue