Skip to content

test: cover the menu state machine and more helpers - #8

Merged
Periicles merged 1 commit into
mainfrom
feat/more-tests
Jun 16, 2026
Merged

test: cover the menu state machine and more helpers#8
Periicles merged 1 commit into
mainfrom
feat/more-tests

Conversation

@Periicles

Copy link
Copy Markdown
Owner

Why

The criterion suite covered the early fixes but not the menu refactor or
several helpers. More coverage = the behaviour we just locked in can't silently
regress.

What

  • test_menu — transitions (menu_push/menu_pop/menu_set_tab) and every
    predicate (menu_in_overworld, menu_show_hud, menu_pause_open,
    menu_pause_active, pause/settings tabs, menu_won/menu_lost). This pins the
    named menu helpers to the exact values the old decimal arithmetic produced.
  • test_str_moremy_strcat, my_strndup, my_str_to_word_array, and
    my_put_nbr / my_float (captured through a temp fd) across INT_MIN..INT_MAX.

Verification

  • make tests_runTested: 20 | Passing: 20 | Failing: 0.
  • make tests_asan → 20/20, no AddressSanitizer / UBSan findings.

Add 10 criterion tests:

- test_menu: exercises the menu transitions (push/pop/set_tab) and every
  predicate (overworld, hud, pause, pause tabs, settings tabs, win/lose),
  locking in that the named helpers behave like the old decimal
  arithmetic.
- test_str_more: my_strcat, my_strndup, my_str_to_word_array, and
  my_put_nbr / my_float (captured through a temp fd) across the full int
  range.

Suite is now 20 tests, all passing under `make tests_run` and
`make tests_asan` (no ASan/UBSan findings).
@Periicles
Periicles merged commit 414c564 into main Jun 16, 2026
8 checks passed
@Periicles
Periicles deleted the feat/more-tests branch June 16, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant