test(coverage): add targeted tests to raise per-package coverage gates
- internal/homesick/version: new version_test.go covers String constant and semver format validation - internal/homesick/cli: add list, generate, clone, status, diff, and git-repo helper tests; coverage raised from 62.5% to 71.2% - internal/homesick/core: new helpers_test.go covers runGit pretend, actionVerb, sayStatus, unlinkPath, linkPath, readSubdirs, matchesIgnoredDir, confirmDestroy, ExecAll edge cases, and Link/Unlink default castle wrappers; core_test.go and pull_test.go extended with New constructor and PullAll quiet-mode tests; exec_test.go extended with ExecAll no-repos-dir and error-wrap tests; coverage raised from 75.6% to 80.2%
This commit is contained in:
@@ -140,3 +140,17 @@ func (s *PullSuite) TestPullAll_PrintsCastlePrefixes() {
|
||||
require.Contains(s.T(), stdout.String(), "alpha:")
|
||||
require.Contains(s.T(), stdout.String(), "zeta:")
|
||||
}
|
||||
|
||||
func (s *PullSuite) TestPullAll_QuietSuppressesCastlePrefixes() {
|
||||
require.NoError(s.T(), os.MkdirAll(filepath.Join(s.reposDir, "alpha", ".git"), 0o755))
|
||||
require.NoError(s.T(), os.MkdirAll(filepath.Join(s.reposDir, "zeta", ".git"), 0o755))
|
||||
|
||||
stdout := &bytes.Buffer{}
|
||||
s.app.Stdout = stdout
|
||||
s.app.Quiet = true
|
||||
s.app.Pretend = true
|
||||
|
||||
require.NoError(s.T(), s.app.PullAll())
|
||||
require.NotContains(s.T(), stdout.String(), "alpha:")
|
||||
require.NotContains(s.T(), stdout.String(), "zeta:")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user