Skip to content

fix: §2.2 spec compliance — no stdout when --output given (v0.5.27)#37

Merged
SoundMatt merged 1 commit into
mainfrom
fix/spec-22-stdout-parity
Jun 13, 2026
Merged

fix: §2.2 spec compliance — no stdout when --output given (v0.5.27)#37
SoundMatt merged 1 commit into
mainfrom
fix/spec-22-stdout-parity

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

  • Remove spurious stdout output from cfusa unece, cfusa iso21434, cfusa comp when --output is given
  • Spec §2.2: "When --output is given, stdout MUST be empty (no double-write)"
  • Previously printed "... written to " confirmation to stdout in all three commands
  • Parity with go-FuSa TestConform_OutputNoStdout_UNECE/ISO21434/Comp
  • Adds 3 §2.2 conformance tests, bumps to v0.5.27

Test plan

  • test_spec22_unece_writes_file_not_stdout — UNECE writes file, exit 0/1
  • test_spec22_iso21434_writes_file_not_stdout — ISO 21434 writes file, exit 0/1
  • test_spec22_comp_writes_file_not_stdout — comp runs without error
  • All 34 test suites pass

cfusa unece, iso21434, and comp were printing "... written to X" to
stdout even when --output was specified, violating spec §2.2 which
requires stdout to be empty when writing to a file. Removes these
printf calls. Parity with go-FuSa TestConform_OutputNoStdout_*.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Comment thread tests/test_new_commands.c
char out_path[256];
snprintf(out_path, sizeof(out_path), "%s/unece_conform.json", NC_DIR);
remove(out_path);
char *argv[] = {"cfusa", "--dir", NC_DIR,
Comment thread tests/test_new_commands.c
char out_path[256];
snprintf(out_path, sizeof(out_path), "%s/iso21434_conform.json", NC_DIR);
remove(out_path);
char *argv[] = {"cfusa", "--dir", NC_DIR,
Comment thread tests/test_new_commands.c
char out_path[256];
snprintf(out_path, sizeof(out_path), "%s/comp_conform.json", NC_DIR);
remove(out_path);
char *argv[] = {"cfusa", "--dir", NC_DIR,
@SoundMatt SoundMatt merged commit d2f118a into main Jun 13, 2026
10 checks passed
@SoundMatt SoundMatt deleted the fix/spec-22-stdout-parity branch June 13, 2026 22:39
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