(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func 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 | |
| 101 | func TestTodoAddLongFlag(t *testing.T) { |
| 102 | server := todoServer(t) |
nothing calls this directly
no test coverage detected