Skip to content

Add unit tests for compute_layout() and print_human() #172

@carpalsgrabby

Description

@carpalsgrabby

Summary

The project currently has no automated tests. Since the core logic lives in compute_layout() and print_human(), adding a small test suite would increase confidence that the layout calculations remain correct as the script evolves.

Tasks

  • Add a tests/ folder using pytest.
  • Test compute_layout() for:
    • basic cases (small leaves/arity)
    • edge cases (leaves=1, arity=2, large values)
    • padding correctness
    • height calculation logic
  • Test print_human() by capturing stdout and verifying formatting.
  • Add a simple GitHub Actions workflow to run tests on push/PR.

Benefit

Ensures core logic remains correct and prevents regression bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions