Add test case

This commit is contained in:
JohnnyMorganz 2024-05-12 13:33:19 +02:00
parent 2a80f5e1d1
commit bd19a9779e

View file

@ -331,4 +331,15 @@ TEST_CASE_FIXTURE(Fixture, "find_expr_ancestry")
CHECK(ancestry.back()->is<AstExprFunction>());
}
TEST_CASE_FIXTURE(BuiltinsFixture, "find_binding_at_position_global_start_of_file")
{
check("local x = string.char(1)");
const Position pos(0, 12);
std::optional<Binding> binding = findBindingAtPosition(*getMainModule(), *getMainSourceModule(), pos);
REQUIRE(binding);
CHECK_EQ(binding->location, Location{Position{0, 0}, Position{0, 0}});
}
TEST_SUITE_END();