MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / TestLint_ResultPreservesInput

Function TestLint_ResultPreservesInput

test/lint_test.go:171–187  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Result preservation ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

169// ---------------------------------------------------------------------------
170
171func TestLint_ResultPreservesInput(t *testing.T) {
172 linter := newDefaultLinter(t)
173 msgs := []string{
174 "feat: add something new",
175 "invalid message",
176 "fix: x",
177 }
178 for _, msg := range msgs {
179 result, err := linter.ParseAndLint(msg)
180 if err != nil {
181 t.Fatalf("unexpected error: %v", err)
182 }
183 if result.Input() != msg {
184 t.Errorf("expected input %q, got %q", msg, result.Input())
185 }
186 }
187}
188
189// ---------------------------------------------------------------------------
190// Severity tests

Callers

nothing calls this directly

Calls 3

newDefaultLinterFunction · 0.85
ParseAndLintMethod · 0.80
InputMethod · 0.80

Tested by

no test coverage detected