* fix(docs): respect workspace.yaml packages_dir setting (fixes #46) * fix(workspace): improve config loading logic (CR feedback) - Expand ~ before resolving relative paths in cmd_registry - Handle LoadWorkspaceConfig errors properly - Update Repo.Path when PackagesDir overrides default - Validate workspace config version - Add unit tests for workspace config loading * docs: add comments and increase test coverage (CR feedback) - Add docstrings to exported functions in pkg/cli - Add unit tests for Semantic Output (pkg/cli/output.go) - Add unit tests for CheckBuilder (pkg/cli/check.go) - Add unit tests for IPC Query/Perform (pkg/framework/core) * fix(test): fix panics and failures in php package tests - Fix panic in TestLookupLinuxKit_Bad by mocking paths - Fix assertion errors in TestGetSSLDir_Bad and TestGetPackageInfo_Bad - Fix formatting in test files * fix(test): correct syntax in services_extended_test.go * fix(ci): point coverage workflow to go.mod instead of go.work * fix(ci): build CLI before running coverage * fix(ci): run go generate for updater package in coverage workflow * fix(github): allow dry-run publish without gh CLI authentication Moves validation check after dry-run check so tests can verify dry-run behavior in CI environments.
49 lines
791 B
Go
49 lines
791 B
Go
package cli
|
|
|
|
import "testing"
|
|
|
|
func TestCheckBuilder(t *testing.T) {
|
|
UseASCII() // Deterministic output
|
|
|
|
// Pass
|
|
c := Check("foo").Pass()
|
|
got := c.String()
|
|
if got == "" {
|
|
t.Error("Empty output for Pass")
|
|
}
|
|
|
|
// Fail
|
|
c = Check("foo").Fail()
|
|
got = c.String()
|
|
if got == "" {
|
|
t.Error("Empty output for Fail")
|
|
}
|
|
|
|
// Skip
|
|
c = Check("foo").Skip()
|
|
got = c.String()
|
|
if got == "" {
|
|
t.Error("Empty output for Skip")
|
|
}
|
|
|
|
// Warn
|
|
c = Check("foo").Warn()
|
|
got = c.String()
|
|
if got == "" {
|
|
t.Error("Empty output for Warn")
|
|
}
|
|
|
|
// Duration
|
|
c = Check("foo").Pass().Duration("1s")
|
|
got = c.String()
|
|
if got == "" {
|
|
t.Error("Empty output for Duration")
|
|
}
|
|
|
|
// Message
|
|
c = Check("foo").Message("status")
|
|
got = c.String()
|
|
if got == "" {
|
|
t.Error("Empty output for Message")
|
|
}
|
|
}
|