MCPcopy Create free account
hub / github.com/checkmake/checkmake / TestCheckmake_WithTextOutput

Function TestCheckmake_WithTextOutput

cmd/checkmake/main_test.go:283–300  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

281}
282
283func TestCheckmake_WithTextOutput(t *testing.T) {
284 out := captureOutput(func() {
285 cmd := newRootCmd()
286 cmd.SilenceErrors = true
287 cmd.SetArgs([]string{
288 "-o", "text",
289 "../../fixtures/missing_phony.make",
290 })
291 _ = cmd.Execute()
292 })
293
294 require.NotEmpty(t, out, "output should not be empty for text format")
295
296 // Text output should contain table-like structure
297 assert.Contains(t, out, "Required target", "should mention violation description")
298 assert.Contains(t, out, "declared PHONY.", "should mention target type")
299 assert.Contains(t, out, "phonydeclared", "should mention phonydeclared error")
300}
301
302func TestCheckmake_WithInvalidOutput(t *testing.T) {
303 cmd := newRootCmd()

Callers

nothing calls this directly

Calls 2

captureOutputFunction · 0.85
newRootCmdFunction · 0.85

Tested by

no test coverage detected