MCPcopy Create free account
hub / github.com/golang/appengine / TestRunningVariadic

Function TestRunningVariadic

v2/delay/delay_test.go:297–327  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

295}
296
297func 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
329func TestErrorFunction(t *testing.T) {
330 c := newFakeContext()

Callers

nothing calls this directly

Calls 4

newFakeContextFunction · 0.70
runFuncFunction · 0.70
NewRequestMethod · 0.65
CallMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…