Merged per the MERGE-ON-GREEN verdict (issuecomment-5384481169): TTY-gated stderr warning on implicit type=blocks default, honoring --quiet and BD_NO_DEP_TYPE_WARNING. Head CI fully green after the misspell fix-push (4fe7c45d8) and a rerun past the known #5962 storage testcontainer flake.
21 lines
682 B
Go
21 lines
682 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestWarnNotesReplacement is the D2 guard test: a `bd update --notes` that
|
|
// replaces a non-empty notes field warns on stderr, naming --append-notes as
|
|
// the history-preserving alternative (the warning itself shipped on main via
|
|
// #4743). The predicate deciding WHEN the warning fires is covered by
|
|
// TestReplacesExistingNotes.
|
|
func TestWarnNotesReplacement(t *testing.T) {
|
|
got := captureStderr(t, func() {
|
|
warnNotesReplacement("tc-dg6")
|
|
})
|
|
|
|
want := "warning: tc-dg6: --notes replaced existing notes (use --append-notes to preserve history)\n"
|
|
if got != want {
|
|
t.Fatalf("warnNotesReplacement stderr = %q, want %q", got, want)
|
|
}
|
|
}
|