(t *testing.T)
| 228 | } |
| 229 | |
| 230 | func TestCursorErrorText(t *testing.T) { |
| 231 | t.Parallel() |
| 232 | |
| 233 | tests := []struct { |
| 234 | name string |
| 235 | evt cursorStreamEvent |
| 236 | want string |
| 237 | }{ |
| 238 | {"error field", cursorStreamEvent{ErrorMsg: "bad request"}, "bad request"}, |
| 239 | {"detail field", cursorStreamEvent{Detail: "not found"}, "not found"}, |
| 240 | {"result field", cursorStreamEvent{ResultText: "failed"}, "failed"}, |
| 241 | {"empty", cursorStreamEvent{}, ""}, |
| 242 | } |
| 243 | |
| 244 | for _, tc := range tests { |
| 245 | t.Run(tc.name, func(t *testing.T) { |
| 246 | got := cursorErrorText(&tc.evt) |
| 247 | if got != tc.want { |
| 248 | t.Errorf("cursorErrorText = %q, want %q", got, tc.want) |
| 249 | } |
| 250 | }) |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | func TestCursorUsageModelFallback(t *testing.T) { |
| 255 | t.Parallel() |
nothing calls this directly
no test coverage detected