1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

tests: Add tests for new --help

This commit is a part of "--help me if you can"

Closes #5680
This commit is contained in:
Emil Engler 2020-07-14 10:32:22 +02:00 committed by Daniel Stenberg
parent aa8777f63f
commit a86cc7e2ab
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
5 changed files with 203 additions and 1 deletions

View File

@ -178,7 +178,7 @@ test1426 test1427 test1428 test1429 test1430 test1431 test1432 test1433 \
test1434 test1435 test1436 test1437 test1438 test1439 test1440 test1441 \
test1442 test1443 test1444 test1445 test1446 test1447 test1448 test1449 \
test1450 test1451 test1452 test1453 test1454 test1455 test1456 test1457 \
test1458 test1459 test1460 \
test1458 test1459 test1460 test1461 test1462 test1463 test1464 \
\
test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \
test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \

53
tests/data/test1461 Normal file
View File

@ -0,0 +1,53 @@
<testcase>
<info>
<keywords>
--help
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<name>
curl important --help
</name>
<command>
--help
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
0
</errorcode>
<stdout mode="text">
Usage: curl [options...] <url>
-d, --data <data> HTTP POST data
-f, --fail Fail silently (no output at all) on HTTP errors
-h, --help <category> Get help for commands
-i, --include Include protocol response headers in the output
-o, --output <file> Write to file instead of stdout
-O, --remote-name Write output to a file named as the remote file
-s, --silent Silent mode
-T, --upload-file <file> Transfer local FILE to destination
-u, --user <user:password> Server user and password
-A, --user-agent <name> Send User-Agent <name> to server
-v, --verbose Make the operation more talkative
-V, --version Show version number and quit
This is not the full help, this menu is stripped into categories.
Use "--help category" to get an overview of all categories.
For all options use the manual or "--help all".
</stdout>
</verify>
</testcase>

61
tests/data/test1462 Normal file
View File

@ -0,0 +1,61 @@
<testcase>
<info>
<keywords>
--help
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<name>
curl invalid category --help
</name>
<command>
--help sdfafdsfadsfsd
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
0
</errorcode>
<stdout mode="text">
Usage: curl [options...] <url>
Invalid category provided, here is a list of all categories:
auth Different types of authentication methods
connection Low level networking operations
curl The command line tool itself
dns General DNS options
file FILE protocol options
ftp FTP protocol options
http HTTP and HTTPS protocol options
imap IMAP protocol options
misc Options that don't fit into any other category
output The output of curl
pop3 POP3 protocol options
post HTTP Post specific options
proxy All options related to proxies
scp SCP protocol options
sftp SFTP protocol options
smtp SMTP protocol options
ssh SSH protocol options
telnet TELNET protocol options
tftp TFTP protocol options
tls All TLS/SSL related options
upload All options for uploads
verbose Options related to any kind of command line output of curl
</stdout>
</verify>
</testcase>

44
tests/data/test1463 Normal file
View File

@ -0,0 +1,44 @@
<testcase>
<info>
<keywords>
FILE
--help
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<features>
file
</features>
<name>
curl file category --help
</name>
<command>
--help file
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
0
</errorcode>
<stdout mode="text">
Usage: curl [options...] <url>
file: FILE protocol options
-I, --head Show document info only
-r, --range <range> Retrieve only the bytes within RANGE
</stdout>
</verify>
</testcase>

44
tests/data/test1464 Normal file
View File

@ -0,0 +1,44 @@
<testcase>
<info>
<keywords>
FILE
--help
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<features>
file
</features>
<name>
curl file category --help with lower/upper mix
</name>
<command>
--help fIlE
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
0
</errorcode>
<stdout mode="text">
Usage: curl [options...] <url>
file: FILE protocol options
-I, --head Show document info only
-r, --range <range> Retrieve only the bytes within RANGE
</stdout>
</verify>
</testcase>