From 7631f2b752a00680ac16742753dd7bd78c3a32ac Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 9 Feb 2020 00:04:05 +0100 Subject: test 970: verify --write-out '%{json}' Makes curl_easy_getinfo() of "variable" numerical content instead return the number set in the env variable `CURL_TIME`. Makes curl_version() of "variable" textual content. This guarantees a stable version string which can be tested against. Environment variable `CURL_VERSION` defines the content. Assisted-by: Mathias Gumz --- tests/data/test970 | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tests/data/test970 (limited to 'tests/data/test970') diff --git a/tests/data/test970 b/tests/data/test970 new file mode 100644 index 000000000..ab1f23081 --- /dev/null +++ b/tests/data/test970 @@ -0,0 +1,77 @@ + + + +HTTP +HTTP GET + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + +# +# Client-side + + +http + + +debug + + +CURL_TIME=13 +CURL_VERSION=curl-unit-test-fake-version + + +HTTP GET with JSON output + + +http://%HOSTIP:%HTTPPORT/970 --write-out '%{json}' + + + +# +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /970 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- +{"url_effective":"http://127.0.0.1:8990/970","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":250,"size_request":85,"size_download":6,"size_upload":0,"speed_download":0.000013,"speed_upload":0.000013,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0,"proxy_ssl_verify_result":0,"filename_effective":null,"remote_ip":"127.0.0.1","remote_port":8990,"local_ip":"127.0.0.1","local_port":13,"http_version":"1.1","scheme":"HTTP","curl_version":"curl-unit-test-fake-version"} + + + -- cgit v1.2.3