Skip to content

test: raise coverage for src/arx/parser.py (module docstring, extern, primary edge cases) #43

@omsherikar

Description

@omsherikar

Summary

src/arx/parser.py is ~97% line coverage; remaining misses are mostly rare module-level and primary-expression paths.

Gaps (from pytest --cov=arx --cov-report=term-missing)

  • parse(): TokenKind.not_initialized consume at start (~92).
  • Module docstring in wrong position (~113–116).
  • Top-level bare ; statements (~119–121).
  • extern: parse_extern path (~129–131, ~189–190) if not already covered by examples.
  • parse_primary: leading ; then recurse (~225–226); docstring in expression position (~232).
  • parse_var_expr: declarations without = relying on _default_value_for_type (~670).

Suggested approach

  • Add compact parser tests in tests/test_parser.py (or a focused file) with minimal valid modules exercising each branch.
  • Align any new examples with docs/library and syntax/arx.syntax.json if language surfaces change (should not be required for pure test additions).

Evidence

Recent local run: parser.py ~424 statements, ~14 missed (~97% cover).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions