mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add more tests
This commit is contained in:
parent
1f8aa1e9f0
commit
cecea7785b
1 changed files with 32 additions and 0 deletions
|
@ -107,6 +107,38 @@ TEST_CASE_FIXTURE(DocumentationSymbolFixture, "overloaded_class_method")
|
|||
CHECK_EQ(symbol, "@test/globaltype/Foo.bar/overload/(Foo, string) -> number");
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(DocumentationSymbolFixture, "table_function_prop")
|
||||
{
|
||||
loadDefinition(R"(
|
||||
declare Foo: {
|
||||
new: (number) -> string
|
||||
}
|
||||
)");
|
||||
|
||||
std::optional<DocumentationSymbol> symbol = getDocSymbol(R"(
|
||||
Foo.new("asdf")
|
||||
)",
|
||||
Position(1, 13));
|
||||
|
||||
CHECK_EQ(symbol, "@test/global/Foo.new");
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(DocumentationSymbolFixture, "table_overloaded_function_prop")
|
||||
{
|
||||
loadDefinition(R"(
|
||||
declare Foo: {
|
||||
new: ((number) -> string) & ((string) -> number)
|
||||
}
|
||||
)");
|
||||
|
||||
std::optional<DocumentationSymbol> symbol = getDocSymbol(R"(
|
||||
Foo.new("asdf")
|
||||
)",
|
||||
Position(1, 13));
|
||||
|
||||
CHECK_EQ(symbol, "@test/global/Foo.new/overload/(string) -> number");
|
||||
}
|
||||
|
||||
TEST_SUITE_END();
|
||||
|
||||
TEST_SUITE_BEGIN("AstQuery");
|
||||
|
|
Loading…
Add table
Reference in a new issue