diff options
-rwxr-xr-x | test/it_url_slow.t | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/it_url_slow.t b/test/it_url_slow.t index 51da6b9..1f43edc 100755 --- a/test/it_url_slow.t +++ b/test/it_url_slow.t @@ -51,6 +51,20 @@ $output = server_output(); if (!$res || !$res2) diag($output); +$start = microtime(true); +$res = ok( + !it_url::get(['url' => 'http://localhost:8000/slow_response', 'maxlength' => 10, 'retries' => 0, 'it_error' => false]), + 'it_url::get() fails for response larger than maxlength' +); +$res2 = is( + intval(microtime(true) - $start), 1, + '... and fails as soon as maxlength is surpassed' +); +sleep(1); # wait for testserver +$output = server_output(); +if (!$res || !$res2) + diag($output); + handle_server( ok( it_url::get(U('http://localhost:8000/repeat', ['string' => "abc", 'num' => 1024 * 1024])) == str_repeat("abc", 1024 * 1024), |