mirror of
https://github.com/openharmony/third_party_toybox.git
synced 2026-07-01 21:34:01 -04:00
2095d741a5
Signed-off-by: gong-guilin <gongguilin@h-partners.com>
16 lines
433 B
Bash
16 lines
433 B
Bash
#!/bin/bash
|
|
|
|
[ -f testing.sh ] && . testing.sh
|
|
|
|
#testing "name" "command" "result" "infile" "stdin"
|
|
|
|
testcmd "static file" \
|
|
"\"\$FILES\" | sed 's/\\r//g;1,/^\$/d'>file; cmp file \$FILES/tar/tar.tar && echo yes" \
|
|
'yes\n' '' 'GET /tar/tar.tar HTTP/1.1\r\n\r\n'
|
|
rm -f file
|
|
|
|
testcmd "mime type" \
|
|
'"$FILES" | tr A-Z a-z | sed -n "s/\r//g;s/^content-type: //p"' "application/x-tar\n" "" \
|
|
'GET /tar/tar.tar HTTP/1.1\r\n\r\n'
|
|
|