Skip to content

[chore] Test gap fills: testutil.LoadFixture panic path and e2e for rimba completion #177

@lugassawan

Description

@lugassawan

Type

  • Tests (coverage gaps, e2e, fixtures)

Files to change

  • testutil/testutil_test.go
  • tests/e2e/completions_test.go (new file)

Description

G4 — testutil.LoadFixture panic path untested
testutil/fixture.go:LoadFixture calls t.Fatalf when the fixture file cannot be read, but testutil/testutil_test.go only tests the happy path (fixture file exists and is readable). The failure path (non-existent file, permission error) is not exercised, which means the error message and the t.Fatalf call itself are untested. Add a subtest that calls LoadFixture with a path that does not exist and asserts that the test is marked as failed (using a testing.TB spy or t.Run with a fresh helper T).

G5 — No e2e test for rimba completion
rimba completion (shell completion generation) has no entry in tests/e2e/. Running rimba completion bash, rimba completion zsh, and rimba completion fish all produce output but are never exercised in the e2e suite. Add a tests/e2e/completions_test.go that:

  1. Builds the rimba binary
  2. Runs rimba completion bash (and optionally zsh, fish)
  3. Asserts exit code 0 and that stdout contains known completion markers (e.g., complete for bash, compdef for zsh)

Acceptance

  • testutil_test.go contains a subtest for LoadFixture with a missing file path; test marked as failed by the helper.
  • tests/e2e/completions_test.go exists and passes for at least bash completion.
  • make test and make test-e2e pass.
  • Coverage does not drop below 97%.

Bundles

Original candidates folded into this issue:

  • G4 (testutil/testutil_test.go): LoadFixture failure path (missing file → t.Fatalf) is not tested.
  • G5 (tests/e2e/): no e2e coverage for rimba completion subcommand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions