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

Function TestTodoAddShortFlag

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

Source from the content-addressed store, hash-verified

81}
82
83func TestTodoAddShortFlag(t *testing.T) {
84 server := todoServer(t)
85 defer server.Close()
86
87 resp, err := runTodoAdd(t, server, "-t", "Buy milk")
88 if err != nil {
89 t.Fatalf("execute: %v", err)
90 }
91
92 data, ok := resp.Data.(map[string]any)
93 if !ok {
94 t.Fatalf("data type = %T, want map[string]any", resp.Data)
95 }
96 if got := data["title"]; got != "Buy milk" {
97 t.Errorf("title = %q, want %q", got, "Buy milk")
98 }
99}
100
101func TestTodoAddLongFlag(t *testing.T) {
102 server := todoServer(t)

Callers

nothing calls this directly

Calls 2

todoServerFunction · 0.85
runTodoAddFunction · 0.85

Tested by

no test coverage detected