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

Function TestTodoAddPositional

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

Source from the content-addressed store, hash-verified

63}
64
65func TestTodoAddPositional(t *testing.T) {
66 server := todoServer(t)
67 defer server.Close()
68
69 resp, err := runTodoAdd(t, server, "Buy milk")
70 if err != nil {
71 t.Fatalf("execute: %v", err)
72 }
73
74 data, ok := resp.Data.(map[string]any)
75 if !ok {
76 t.Fatalf("data type = %T, want map[string]any", resp.Data)
77 }
78 if got := data["title"]; got != "Buy milk" {
79 t.Errorf("title = %q, want %q", got, "Buy milk")
80 }
81}
82
83func TestTodoAddShortFlag(t *testing.T) {
84 server := todoServer(t)

Callers

nothing calls this directly

Calls 2

todoServerFunction · 0.85
runTodoAddFunction · 0.85

Tested by

no test coverage detected