Skip to content

Add shell unit tests for resolver and verify scripts #28

@lex57ukr

Description

@lex57ukr

Problem

There are no automated tests for the resolve or verify helper functions. Testing currently requires manual integration testing with live GitHub/npm/luarocks APIs, making regressions hard to catch.

Proposal

Add a shell test framework (e.g. bats-core) with unit tests for:

  • normalize_version edge cases (v-prefix, luarocks suffix, plain versions)
  • validate_sha256 (valid hashes, invalid hashes, empty strings)
  • resolve_local (pinned override vs. current value)
  • check in verify.sh (tool present, tool missing, version mismatch)

Integration tests for the full resolve pipeline can be added separately if needed.

Context

Flagged by both reviews. The shared library functions in scripts/lib/ are the most testable and highest-value targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions