Skip to content

Commit 37dd63b

Browse files
committed
test(coverage): allow grammar coalescing in macro scan fixture
1 parent 2334969 commit 37dd63b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎tests/test_extraction.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,14 @@ TEST(macro_check_skips_source_for_regions_outside_functions_issue1735) {
265265
CBMFileResult *r = extract(src, CBM_LANG_C, "t", "junk.c");
266266
uint64_t scanned = cbm_test_macro_line_scan_bytes() - before;
267267
ASSERT_NOT_NULL(r);
268-
ASSERT_TRUE(r->parse_incomplete);
269-
ASSERT_EQ(r->error_region_count, 40);
270-
ASSERT_EQ(scanned, 0u);
268+
bool incomplete = r->parse_incomplete;
269+
int regions = r->error_region_count;
271270
cbm_free_result(r);
271+
ASSERT_TRUE(incomplete);
272+
/* This fork's grammar can merge the top-level junk into one region. The
273+
* invariant is that gaps remain reported without reading source bytes. */
274+
ASSERT(regions > 0);
275+
ASSERT_EQ(scanned, 0u);
272276
PASS();
273277
}
274278

0 commit comments

Comments
 (0)