summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-10-11 17:35:07 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-10-11 22:52:30 +0200
commite38d2e5a5095cfb5ca8e046ff6ae710ad5af1cbf (patch)
tree3800b87d43f3e225f885191ed8eeb3ed2827d073
parent8758a26f88789928ec8f8266038d40fa9041b48c (diff)
downloadcurl-e38d2e5a5095cfb5ca8e046ff6ae710ad5af1cbf.tar.gz
test368: verify dash is appended for "-r [num]"
Follow-up to 8758a26f8878
-rw-r--r--tests/data/Makefile.inc2
-rw-r--r--tests/data/test36849
2 files changed, 50 insertions, 1 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index 1085e7bf0..ffdabb4c8 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -60,7 +60,7 @@ test325 test326 test327 test328 test329 test330 test331 test332 test333 \
test334 test335 test336 test337 test338 test339 test340 test341 test342 \
test343 test344 test345 test346 test347 test348 test349 test350 test351 \
test352 test353 test354 test355 test356 test357 test358 test359 test360 \
-test361 test362 test363 test364 test365 test366 test367 \
+test361 test362 test363 test364 test365 test366 test367 test368 \
\
test392 test393 test394 test395 test396 test397 \
\
diff --git a/tests/data/test368 b/tests/data/test368
new file mode 100644
index 000000000..2f13b5723
--- /dev/null
+++ b/tests/data/test368
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+Appened dash if -r range specified without one
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER -r 4
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Range: bytes=4-
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>