beads/cmd/bd/protocol/comments_test.go
quartz 801965ae2d feat(test): parallelize protocol tests for 3x speedup (bd-dgp)
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
2026-02-27 20:04:00 -08:00

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")
}
})
}