From a1ea72d719b63a4d2b6421ce2e53b7e3ab12a8a1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 23 Feb 2024 18:50:28 +0300 Subject: Add curl constructors which allow to adjust curl command line --- tests/curl/driver.cxx | 13 +++++++++++++ tests/curl/testscript | 10 ++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'tests/curl') diff --git a/tests/curl/driver.cxx b/tests/curl/driver.cxx index 4cf1815..bd12c29 100644 --- a/tests/curl/driver.cxx +++ b/tests/curl/driver.cxx @@ -105,6 +105,19 @@ http () assert (!c.wait ()); } + // POST from stream without --fail. + // + { + curl c (p, path ("-"), nullfd, 2, + curl::post, + curl::flags::no_fail, + u + "/bogus"); + + c.out << "bogus" << endl; + c.out.close (); + assert (c.wait ()); + } + // POST from /dev/null. // { diff --git a/tests/curl/testscript b/tests/curl/testscript index d26a39c..5818d1a 100644 --- a/tests/curl/testscript +++ b/tests/curl/testscript @@ -45,15 +45,17 @@ sudo /usr/sbin/in.tftpd \ { $* 'http' 2>>~%EOE% - curl -s -S --fail --location https://build2.org/bogus + curl -sS --fail --location https://build2.org/bogus %curl: \(22\) The requested URL returned error: 404( Not Found)?% - curl -s -S --fail --location https://build2.org + curl -sS --fail --location https://build2.org - curl -s -S --fail --location --data-binary @- https://build2.org/bogus + curl -sS --fail --location --data-binary @- https://build2.org/bogus %curl: \(22\) The requested URL returned error: 404( Not Found)?% - curl -s -S --fail --location https://build2.org/bogus + curl -sS --location --data-binary @- https://build2.org/bogus + + curl -sS --fail --location https://build2.org/bogus %curl: \(22\) The requested URL returned error: 404( Not Found)?% EOE } -- cgit v1.1