Add t.Parallel() to all 45 top-level test functions in cmd/bd/protocol. Each test already creates a fully isolated workspace (unique Dolt prefix, temp dir, git repo) so parallelization is safe. Reduces test time from ~135s to ~42s on the same machine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Executed-By: beads/polecats/quartz Rig: beads Role: polecats
25 lines
725 B
Go
25 lines
725 B
Go
package protocol
|
|
|
|
import "testing"
|
|
|
|
// TestProtocol_CommentRejectsEmptyText asserts that bd comments add rejects
|
|
// empty and whitespace-only comment text with a non-zero exit code.
|
|
func TestProtocol_CommentRejectsEmptyText(t *testing.T) {
|
|
t.Parallel()
|
|
w := newWorkspace(t)
|
|
id := w.create("--title", "Comment target", "--type", "task")
|
|
|
|
t.Run("empty", func(t *testing.T) {
|
|
_, err := w.tryRun("comments", "add", id, "")
|
|
if err == nil {
|
|
t.Error("bd comments add with empty text should fail but exited 0")
|
|
}
|
|
})
|
|
|
|
t.Run("whitespace", func(t *testing.T) {
|
|
_, err := w.tryRun("comments", "add", id, " ")
|
|
if err == nil {
|
|
t.Error("bd comments add with whitespace-only text should fail but exited 0")
|
|
}
|
|
})
|
|
}
|