(t *testing.T)
| 274 | } |
| 275 | |
| 276 | func TestRunningVariadic(t *testing.T) { |
| 277 | c := newFakeContext() |
| 278 | |
| 279 | // Fake out the adding of a task. |
| 280 | var task *taskqueue.Task |
| 281 | taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) { |
| 282 | if queue != "" { |
| 283 | t.Errorf(`Got queue %q, expected ""`, queue) |
| 284 | } |
| 285 | task = tk |
| 286 | return tk, nil |
| 287 | } |
| 288 | |
| 289 | varFuncMsg = "" // reset state |
| 290 | varFunc.Call(c.ctx, "Amiga %d has %d KB RAM", 500, 512) |
| 291 | |
| 292 | // Simulate the Task Queue service. |
| 293 | req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload)) |
| 294 | if err != nil { |
| 295 | t.Fatalf("Failed making http.Request: %v", err) |
| 296 | } |
| 297 | rw := httptest.NewRecorder() |
| 298 | runFunc(c.ctx, rw, req) |
| 299 | |
| 300 | const expected = "Amiga 500 has 512 KB RAM" |
| 301 | if varFuncMsg != expected { |
| 302 | t.Errorf("varFuncMsg = %q, want %q", varFuncMsg, expected) |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | func TestErrorFunction(t *testing.T) { |
| 307 | c := newFakeContext() |
nothing calls this directly
no test coverage detected
searching dependent graphs…