(t *testing.T)
| 63 | } |
| 64 | |
| 65 | func 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 | |
| 83 | func TestTodoAddShortFlag(t *testing.T) { |
| 84 | server := todoServer(t) |
nothing calls this directly
no test coverage detected