Skip to content

test: make half-block composer fixture portable - #2440

Closed
coreldh wants to merge 1 commit into
kunchenguid:mainfrom
coreldh:fm/c0815-fm-composer-edge
Closed

coreldh wants to merge 1 commit into
kunchenguid:mainfrom
coreldh:fm/c0815-fm-composer-edge

Conversation

@coreldh

@coreldh coreldh commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Intent

Repair the pre-existing default-branch failure in tests/fm-composer-lib.test.sh without weakening the half-block structural-edge property. Determine whether production or the environment is at fault first. The production matcher already recognizes U+2580 and U+2584; host Bash 3.2 emits literal backslash-u text for printf '\u…'. Make the test construct verified UTF-8 source literals instead, fail loudly if the fixture bytes are not preserved, keep the focused test single-purpose, and prove both half-block production alternatives remain enforced.

What Changed

  • Replace Bash-dependent Unicode escapes with portable UTF-8 source literals in the half-block composer fixture.
  • Verify the exact fixture bytes and fail loudly if either U+2584 or U+2580 is not preserved.
  • Keep independent structural-edge assertions for both half-block alternatives while reusing the verified literals in the end-to-end fixture.

Risk Assessment

✅ Low: Captain, the test-only change is narrowly scoped and preserves independent byte and matcher enforcement for both U+2580 and U+2584.

Testing

Inspected the base-to-target change and production matcher, reproduced Bash 3.2’s literal backslash-u behavior, passed the focused composer test in ambient and C locales, and captured an end-to-end transcript proving both verified UTF-8 half-block alternatives prevent footer swallowing while a non-edge does not.

Evidence: Half-block end-to-end transcript

Bash 3.2 emitted literal \u2580 bytes; verified UTF-8 literals for U+2584 and U+2580 both yielded empty, while the non-edge counterfactual yielded pending. SHA-256: 26e718a0a701e7d91dae146f76e2ceaf27d8da78470ea5d1c613bf0a79ab0316

^D��host_bash=3.2.57(1)-release
legacy_printf_backslash_u_bytes=5c7532353830
literal_U+2584_x8_bytes=e29684e29684e29684e29684e29684e29684e29684e29684
literal_U+2580_x8_bytes=e29680e29680e29680e29680e29680e29680e29680e29680
U+2584_structural_edge=enforced
U+2584_rule_end_to_end_verdict=empty
U+2580_structural_edge=enforced
U+2580_rule_end_to_end_verdict=empty
non_edge_counterfactual_verdict=pending

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Inspected git diff f1a4af426d7199c1781bc91ccd143b8e1f732d10..eb25d1f401918f50536481f5f37c6e557652339a and the production edge matcher.
  • Confirmed host /bin/bash is GNU Bash 3.2.57 and its printf '\u2580' emits literal bytes 5c7532353830.
  • /bin/bash tests/fm-composer-lib.test.sh
  • LC_ALL=C /bin/bash tests/fm-composer-lib.test.sh
  • Captured a manual public-interface transcript verifying exact fixture bytes, independent U+2584/U+2580 edge behavior, end-to-end empty verdicts, and the pending non-edge counterfactual.
  • Verified git status --short remained empty after testing.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@tiago-peixoto

Copy link
Copy Markdown
Contributor

Additional evidence for the fixture defect this PR already addresses: pristine upstream main 8f7b79c77c2198a71a01082215227a64500015e3 still fails tests/fm-composer-lib.test.sh with a half-block rule row must count as a structural edge under macOS Bash 3.2.57. The same assertion fails on #3766's contribution head in the paired comparison.

With LANG=LC_ALL=C.UTF-8, bash -c 'printf "\u2580\n"' | od -An -tx1 produced 5c 75 32 35 38 30 0a: literal \u2580 plus newline, not the intended glyph. This distinguishes the observed failure from a production classifier defect or simply a non-UTF-8 locale.

This is baseline reproduction evidence, not a review or validation of this PR's current head. We found this existing narrowly scoped thread and are opening no duplicate issue or competing PR.

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.

2 participants