04f17f8616
ci / vet, staticcheck, test, build (push) Successful in 2m25s
- Added comprehensive table-driven test suites for all packages: cmd/glint, cicontext, fetcher, graph, linter, model, resolver. Coverage reaches 98%+ statement coverage across the codebase. - Replaced os.Exit calls in cmd/glint with an `exit` variable so tests can capture exit codes without terminating the test process. - Removed unreachable code found during coverage analysis: dead guard in cicontext.parseRegexLiteral; dead len(jobs)==0 branch in graph.Pipeline; skipWin struct field and dead continue in graph.convertToPNG; pipelineSVG return type simplified to string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
493 B
Go
23 lines
493 B
Go
package model
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSetJobOrigin(t *testing.T) {
|
|
p := &Pipeline{
|
|
Jobs: map[string]Job{
|
|
"with-file": {Name: "with-file", File: "existing.yml"},
|
|
"no-file": {Name: "no-file"},
|
|
},
|
|
}
|
|
p.SetJobOrigin("default.yml")
|
|
|
|
if p.Jobs["with-file"].File != "existing.yml" {
|
|
t.Error("job with existing File should not be overwritten")
|
|
}
|
|
if p.Jobs["no-file"].File != "default.yml" {
|
|
t.Errorf("job without File should be set: got %q", p.Jobs["no-file"].File)
|
|
}
|
|
}
|