test(api-discovery): add comment-strip and namespace-less assertions

Adds 9 new assertions covering the two recent api-discovery fixes:

parse_lua_surface (4 new):
- commented-out function-declarations are stripped (function-form and
  assignment-form)
- inline-comment after a real declaration does not break the match

parse_readme_api (5 new):
- namespace-less H3 headers (e.g. \`run_tests(ctx)\`) are captured
- mixed namespaced + namespace-less in the same section captures both
  without duplicates

Coverage Statement updated: 43 -> 52 total assertions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-05-16 17:51:40 +02:00
parent efa1a5ebcc
commit 338fd050de
2 changed files with 61 additions and 3 deletions

View File

@@ -8,13 +8,13 @@ Per Fault-Injection-Audit-Convention (2026-05-16):
| Function | Assertion-Count | Coverage |
|---|---|---|
| `parse_lua_surface` | 15 | Happy-path (2 public + 1 private), empty-source edge, sugar-form (`function M.foo`), mixed-form (sugar + explicit) |
| `parse_readme_api` | 4 | Standard H3-pattern, no-API-section edge |
| `parse_lua_surface` | 19 | Happy-path (2 public + 1 private), empty-source edge, sugar-form (`function M.foo`), mixed-form (sugar + explicit), comment-stripping (commented stubs, inline-comment after code) |
| `parse_readme_api` | 9 | Standard H3-pattern, no-API-section edge, namespace-less function (e.g. `run_tests`), mixed namespaced + namespace-less |
| `diff_surface` | 5 | Equal (no diff), surface-superset (missing), doc-superset (stale) |
| `grep_engine_calls` | 5 | 3 unique calls, no-calls edge |
| `generate_topology_block` | 6 | Lib-with-deps+engine, asset-lib (no deps, no engine) |
| `validate_readme_structure` | 8 | Complete core, missing-API core, missing-Topology, missing-Badges, community-tier-no-enforcement |
| **TOTAL** | **43** | |
| **TOTAL** | **52** | |
### Tested-Surface
- All 6 public functions of `lib-core.api-discovery` v0.1.0.