Skip to content

Commit

Permalink
libnixf/Parse: unit tests for #345
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Feb 8, 2024
1 parent ef62100 commit f285f43
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libnixf/test/Parse/ParserAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ TEST(Parser, AttrsBinding) {
ASSERT_TRUE(B.binds()->bindings()[1]->range().rCur().isAt(3, 8, 20));
}

TEST(Parser, AttrsBindingEarlyExit) {
auto Src = R"(
{
a; # Missing =, but not continue parsing "expr"
}
)"sv;

std::vector<Diagnostic> Diags;
auto AST = nixf::parse(Src, Diags);

ASSERT_TRUE(AST);

ASSERT_EQ(Diags.size(), 2);
}

TEST(Parser, AttrsBindingInherit) {
auto Src = R"(
{
Expand Down

0 comments on commit f285f43

Please sign in to comment.