mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
add test for download
This commit is contained in:
parent
69c16b0a5d
commit
8813dd64f9
3 changed files with 25 additions and 0 deletions
2
tests/dl-out.expect
Normal file
2
tests/dl-out.expect
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
serve directory . on http://127.0.0.1:8083
|
||||||
|
0 0 52428800 data2
|
||||||
12
tests/download_chunked.sh
Executable file
12
tests/download_chunked.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
SERVER=$1
|
||||||
|
"$SERVER" . -p 8083 &
|
||||||
|
|
||||||
|
sleep 0.1
|
||||||
|
|
||||||
|
curl -N 'http://localhost:8083/foo_50' -o data2 \
|
||||||
|
-H 'Tranfer-encoding: chunked'
|
||||||
|
|
||||||
|
kill %1
|
||||||
|
wc data2
|
||||||
11
tests/dune
11
tests/dune
|
|
@ -29,3 +29,14 @@
|
||||||
(rule
|
(rule
|
||||||
(alias runtest)
|
(alias runtest)
|
||||||
(action (diff upload-out.expect upload-out)))
|
(action (diff upload-out.expect upload-out)))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
(targets dl-out)
|
||||||
|
(deps (:bin ../src/bin/http_of_dir.exe) foo_50)
|
||||||
|
(locks /port)
|
||||||
|
(action (with-stdout-to %{targets}
|
||||||
|
(run ./download_chunked.sh %{bin}))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
(alias runtest)
|
||||||
|
(action (diff dl-out.expect dl-out)))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue