summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2017-02-11 12:43:16 +0100
committerDominik Picheta <dominikpicheta@gmail.com>2017-02-11 12:43:16 +0100
commit1b4067a81b627ee7f1aeec4d29cd70756be57a5f (patch)
tree536332230fbad520883defb411e94c7c9e426cf4 /tests/stdlib
parent77071eb767dabc78ea23c0ea623331acac640694 (diff)
downloadNim-1b4067a81b627ee7f1aeec4d29cd70756be57a5f.tar.gz
Implement streamed body reading in httpclient.
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/thttpclient.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/stdlib/thttpclient.nim b/tests/stdlib/thttpclient.nim
index 7b1111f9b..c5739f0e1 100644
--- a/tests/stdlib/thttpclient.nim
+++ b/tests/stdlib/thttpclient.nim
@@ -13,7 +13,9 @@ proc asyncTest() {.async.} =
   var client = newAsyncHttpClient()
   var resp = await client.request("http://example.com/")
   doAssert(resp.code.is2xx)
-  doAssert("<title>Example Domain</title>" in resp.body)
+  var body = await resp.body
+  body = await resp.body # Test caching
+  doAssert("<title>Example Domain</title>" in body)
 
   resp = await client.request("http://example.com/404")
   doAssert(resp.code.is4xx)