From f1d7cdee50f9424900fb34578bbdc9790ab39ad9 Mon Sep 17 00:00:00 2001 From: mikespook Date: Tue, 17 May 2011 18:22:12 +0800 Subject: [PATCH] fixed the test --- src/pkg/gearman/gearman_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pkg/gearman/gearman_test.go b/src/pkg/gearman/gearman_test.go index e00f7df..caa7f30 100644 --- a/src/pkg/gearman/gearman_test.go +++ b/src/pkg/gearman/gearman_test.go @@ -15,7 +15,7 @@ func TestAddServer(t *testing.T) { if err := worker.AddServer("127.0.0.1:4730"); err != nil { t.Error(err) } - + if l := len(worker.servers); l != 1 { t.Log(worker.servers) t.Error("The length of server list should be 1.") @@ -43,6 +43,14 @@ func TestEcho(t * testing.T) { } } +func TestResult(t *testing.T) { + if job := worker.Result(); job == nil { + t.Error("Nothing in result.") + } else { + t.Log(job) + } +} + func TestClose(t *testing.T) { if err := worker.Close(); err != nil { t.Error(err)