(t *testing.T)
| 295 | } |
| 296 | |
| 297 | func TestRunningVariadic(t *testing.T) { |
| 298 | c := newFakeContext() |
| 299 | |
| 300 | // Fake out the adding of a task. |
| 301 | var task *taskqueue.Task |
| 302 | taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) { |
| 303 | if queue != "" { |
| 304 | t.Errorf(`Got queue %q, expected ""`, queue) |
| 305 | } |
| 306 | task = tk |
| 307 | return tk, nil |
| 308 | } |
| 309 | |
| 310 | for _, testTarget := range []*Function{varFunc, varRegister} { |
| 311 | varFMsg = "" // reset state |
| 312 | testTarget.Call(c.ctx, "Amiga %d has %d KB RAM", 500, 512) |
| 313 | |
| 314 | // Simulate the Task Queue service. |
| 315 | req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload)) |
| 316 | if err != nil { |
| 317 | t.Fatalf("Failed making http.Request: %v", err) |
| 318 | } |
| 319 | rw := httptest.NewRecorder() |
| 320 | runFunc(c.ctx, rw, req) |
| 321 | |
| 322 | const expected = "Amiga 500 has 512 KB RAM" |
| 323 | if varFMsg != expected { |
| 324 | t.Errorf("varFMsg = %q, want %q", varFMsg, expected) |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | func TestErrorFunction(t *testing.T) { |
| 330 | c := newFakeContext() |
nothing calls this directly
no test coverage detected
searching dependent graphs…