MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestTodoAddLongFlag

Function TestTodoAddLongFlag

internal/cmd/todo_test.go:101–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func TestTodoAddLongFlag(t *testing.T) {
102 server := todoServer(t)
103 defer server.Close()
104
105 resp, err := runTodoAdd(t, server, "--title", "Buy milk")
106 if err != nil {
107 t.Fatalf("execute: %v", err)
108 }
109
110 data, ok := resp.Data.(map[string]any)
111 if !ok {
112 t.Fatalf("data type = %T, want map[string]any", resp.Data)
113 }
114 if got := data["title"]; got != "Buy milk" {
115 t.Errorf("title = %q, want %q", got, "Buy milk")
116 }
117}
118
119func TestTodoAddConflict(t *testing.T) {
120 server := todoServer(t)

Callers

nothing calls this directly

Calls 2

todoServerFunction · 0.85
runTodoAddFunction · 0.85

Tested by

no test coverage detected