Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ func TestReplaceVeleroWithOADP_ScheduleCreateVerbFirst(t *testing.T) {
if wantCount != 2 {
t.Errorf("Expected 2 occurrences of 'oc oadp schedule create NAME', got %d\nActual output:\n%s", wantCount, cmd.Example)
}

// Exact-output assertion: compare cmd.Example with the complete expected
// normalized string so any drift in whitespace, ordering, or replacement
// logic is caught immediately.
expected := ` # Create a backup every 6 hours.
oc oadp schedule create NAME --schedule="0 */6 * * *"

# Create a backup every 6 hours with the @every notation.
oc oadp schedule create NAME --schedule="@every 6h"`
if cmd.Example != expected {
t.Errorf("Exact output mismatch after schedule-create normalization.\nExpected:\n%s\nActual:\n%s", expected, cmd.Example)
}
}

// TestReplaceVeleroWithOADP_RunFunctionWrapper tests stdout capture and replacement
Expand Down
Loading