Repository navigation
Add unit tests for modules/cmdrunner (0% → 88% coverage) - #2136
Merged
Seanstoppable merged 1 commit intoJul 26, 2026
Merged
Seanstoppable merged 1 commit into
Seanstoppable merged 1 commit into
Conversation
Table-driven tests covering: - Settings parsing from YAML (defaults, full config, edge cases) - Widget.String() title formatting - Buffer writing and maxLines line draining - Environment variable construction - Error handling into the output buffer - runCommand with real safe commands (echo) and a nonexistent binary - content() title/text rendering, including default-title fallback - End-to-end NewWidget/Refresh loop using a real command
Seanstoppable
force-pushed
the
seanstoppable-cmdrunner-test-coverage
branch
from
July 26, 2026 03:20
60d0e20 to
55a441c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds table-driven unit tests for
modules/cmdrunner, raising test coverage from 0% to 88.0%.Tests added
settings_test.goNewSettingsFromYAML: defaults, fully specified config, cmd without argsConfigTextwidget_test.goWidget.String()title formatting (no args, single arg, multiple args, empty command)maxLinesline-draining behavior (under/at/over limit, zero limit)drainLineserror path when insufficient lines existenvironment()construction (WTF_WIDGET_WIDTH/HEIGHT + inherited env)handleErrorwriting errors into the output bufferrunCommandusing real, safe commands (echo) plus a nonexistent-binary error casecontent()title/text rendering, including fallback to the rendered command string as titleNewWidget+Refreshwith a real command through the actual goroutine pipelineValidation
go build ./...passesgo test ./modules/cmdrunner/... -coverpasses, 88.0% coveragegolangci-lint run ./modules/cmdrunner/...passes for all new/modified files (3 pre-existing gofmt findings remain in untouched filessettings.go,widget.go,pty_windows.go, caused by this repo's Windowscore.autocrlfcheckout behavior — unrelated to this change)No behavioral changes to production code.