Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyMorganz committed May 12, 2024
1 parent 2a80f5e commit bd19a97
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/AstQuery.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit bd19a97

Please sign in to comment.