diff options
-rw-r--r-- | dispatcher_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dispatcher_test.go b/dispatcher_test.go new file mode 100644 index 0000000..845833c --- /dev/null +++ b/dispatcher_test.go @@ -0,0 +1,22 @@ +package mooh + +import ( + "testing" +) + +func testDispatcher (req *Request) (Response, error) { + resp := Response{} + return resp, nil +} + +func testBasic(t *testing.T) { + d := BuildDispatcher() + err := d.AddRoute(&Route{Method:"GET", Path:"/", Code: testDispatcher}) + if err != nil { + t.Fatal() + } + err = d.AddRoute(&Route{Method: "GET", Path:"/", Code: testDispatcher}) + if err == nil { + t.Fatal() + } +} |