Skip to content

Add round-trip parity test for config CLI/TUI surfaces#5

Open
wydrox wants to merge 1 commit intomainfrom
test/config-roundtrip
Open

Add round-trip parity test for config CLI/TUI surfaces#5
wydrox wants to merge 1 commit intomainfrom
test/config-roundtrip

Conversation

@wydrox
Copy link
Copy Markdown
Owner

@wydrox wydrox commented Apr 20, 2026

Summary

  • Adds internal/commands/config_roundtrip_test.go enforcing that every exported config.Config field is wired into both martmart config set (CLI flag) and internal/tui/config.go (interactive editor).
  • Three assertions: a reference map for field -> flag kebab-case names (TestConfigFieldsCovered), per-field CLI flag lookup (TestConfigStructHasCLISetterFlag), and source-file substring check for the TUI (TestConfigStructIsReferencedByTUI).
  • Guards against the classic failure mode where a new Config field ships in only one editing channel.

Test plan

  • go vet ./...
  • go test ./... -race
  • go build -o bin/martmart ./cmd/martmart
  • ./bin/martmart --help
  • ./bin/martmart config show
  • go test ./internal/commands/ -run 'Config(Struct|FieldsCovered)' -v

Enforces every exported config.Config field has both a matching flag on
`martmart config set` and a reference in internal/tui/config.go, so a
new field cannot silently ship without being editable from both
channels.
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