Updated tests debugging

This commit is contained in:
Leonid Bugaev
2013-09-15 12:47:10 +04:00
parent 5aca51e5b1
commit 26455e4e52
+8 -3
View File
@@ -99,14 +99,19 @@ func TestReplay(t *testing.T) {
received := make(chan int)
listenHandler := func(w http.ResponseWriter, r *http.Request) {
http.Error(w, "OK", http.StatusNotFound)
http.Error(w, "OK", http.StatusFound)
}
replayHandler := func(w http.ResponseWriter, r *http.Request) {
isEqual(t, r.URL.Path, request.URL.Path)
isEqual(t, r.Cookies()[0].Value, request.Cookies()[0].Value)
http.Error(w, "404 page not found", http.StatusNotFound)
if len(r.Cookies()) > 0 {
isEqual(t, r.Cookies()[0].Value, request.Cookies()[0].Value)
} else {
t.Error("Cookies should not be blank")
}
http.Error(w, "OK", http.StatusFound)
if t.Failed() {
fmt.Println("\nReplayed:", r, "\nOriginal:", request)