Skip to content

Commit

Permalink
fixes tests by using \r\n
Browse files Browse the repository at this point in the history
  • Loading branch information
mvrilo committed Jul 18, 2014
1 parent 037793c commit 273d911
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eventsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ func TestConnection(t *testing.T) {
conn, resp := startEventStream(t, e)
defer conn.Close()

if !strings.Contains(string(resp), "HTTP/1.1 200 OK\n") {
if !strings.Contains(string(resp), "HTTP/1.1 200 OK\r\n") {
t.Error("the response has no HTTP status")
}

if !strings.Contains(string(resp), "Content-Type: text/event-stream\n") {
if !strings.Contains(string(resp), "Content-Type: text/event-stream\r\n") {
t.Error("the response has no Content-Type header with value 'text/event-stream'")
}
}
Expand All @@ -117,19 +117,19 @@ func TestConnectionWithCustomHeaders(t *testing.T) {
conn, resp := startEventStream(t, e)
defer conn.Close()

if !strings.Contains(string(resp), "HTTP/1.1 200 OK\n") {
if !strings.Contains(string(resp), "HTTP/1.1 200 OK\r\n") {
t.Error("the response has no HTTP status")
}

if !strings.Contains(string(resp), "Content-Type: text/event-stream\n") {
if !strings.Contains(string(resp), "Content-Type: text/event-stream\r\n") {
t.Error("the response has no Content-Type header with value 'text/event-stream'")
}

if !strings.Contains(string(resp), "X-Accel-Buffering: no\n") {
if !strings.Contains(string(resp), "X-Accel-Buffering: no\r\n") {
t.Error("the response has no X-Accel-Buffering header with value 'no'")
}

if !strings.Contains(string(resp), "Access-Control-Allow-Origin: *\n") {
if !strings.Contains(string(resp), "Access-Control-Allow-Origin: *\r\n") {
t.Error("the response has no Access-Control-Allow-Origin header with value '*'")
}
}
Expand Down

0 comments on commit 273d911

Please sign in to comment.