Skip to content

Commit 878121a

Browse files
committed
adapt handler tests
that now read files that include newline at EOF
1 parent ec7fb7c commit 878121a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/handlers.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ end
298298
request = HTTP.Request("GET", "/_dash-component-suites/dash_renderer/dash-renderer/dash_renderer.js")
299299
resp = Dash.HttpHelpers.handle(handler, request)
300300
@test resp.status == 200
301-
@test String(resp.body) == "var a = [1,2,3,4,5,6]"
301+
@test String(resp.body) == "var a = [1,2,3,4,5,6]\n"
302302
@test HTTP.hasheader(resp, "ETag")
303-
@test HTTP.header(resp, "ETag") == bytes2hex(md5("var a = [1,2,3,4,5,6]"))
303+
@test HTTP.header(resp, "ETag") == bytes2hex(md5("var a = [1,2,3,4,5,6]\n"))
304304
@test HTTP.header(resp, "Content-Type") == "application/javascript"
305305

306306
etag = HTTP.header(resp, "ETag")
@@ -312,9 +312,9 @@ end
312312
resp = Dash.HttpHelpers.handle(handler, request)
313313
HTTP.setheader(request, "If-None-Match"=>bytes2hex(md5("var a = [1,2,3,4,5,6]")))
314314
@test resp.status == 200
315-
@test String(resp.body) == "var string = \"fffffff\""
315+
@test String(resp.body) == "var string = \"fffffff\"\n"
316316
@test HTTP.hasheader(resp, "ETag")
317-
@test HTTP.header(resp, "ETag") == bytes2hex(md5("var string = \"fffffff\""))
317+
@test HTTP.header(resp, "ETag") == bytes2hex(md5("var string = \"fffffff\"\n"))
318318
etag = HTTP.header(resp, "ETag")
319319
HTTP.setheader(request, "If-None-Match"=>etag)
320320
resp = Dash.HttpHelpers.handle(handler, request)
@@ -325,7 +325,7 @@ end
325325
resp = Dash.HttpHelpers.handle(handler, request)
326326
HTTP.setheader(request, "If-None-Match"=>bytes2hex(md5("var a = [1,2,3,4,5,6]")))
327327
@test resp.status == 200
328-
@test String(resp.body) == "var string = \"fffffff\""
328+
@test String(resp.body) == "var string = \"fffffff\"\n"
329329
@test HTTP.hasheader(resp, "Cache-Control")
330330

331331
end

0 commit comments

Comments
 (0)