mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Also test parsing of EPLF FTP reponses
This commit is contained in:
parent
feb076a84a
commit
c1eb5aa24f
@ -62,16 +62,7 @@ parse_ftp_number(unsigned char **src, unsigned char *end, long from, long to)
|
||||
/* Parser for the EPLF format (see http://pobox.com/~djb/proto/eplf.txt).
|
||||
*
|
||||
* Lines end with \r\n (CR-LF), but that is handled elsewhere.
|
||||
*
|
||||
* Some example EPLF response, with the filename separator (tab) displayed as a
|
||||
* space:
|
||||
*/
|
||||
#ifdef DEBUG_FTP_PARSER
|
||||
static unsigned char ftp_eplf_responses[] =
|
||||
"+i8388621.48594,m825718503,r,s280,\tdjb.html\r\n"
|
||||
"+i8388621.50690,m824255907,/,\t514\r\n"
|
||||
"+i8388621.48598,m824253270,r,s612,\t514.html\r\n";
|
||||
#endif
|
||||
|
||||
enum ftp_eplf {
|
||||
FTP_EPLF_FILENAME = ASCII_TAB, /* Filename follows */
|
||||
|
@ -19,7 +19,7 @@ test_ftp_response_expect_success () {
|
||||
response="$(echo "$response" | sed -n '2,$p')"
|
||||
|
||||
test_expect_success "$desc" \
|
||||
"ftp-parser --response '$response'"
|
||||
"ftp-parser --response \"$response\""
|
||||
}
|
||||
|
||||
test_ftp_response_expect_failure () {
|
||||
@ -29,7 +29,7 @@ test_ftp_response_expect_failure () {
|
||||
response="$(echo "$response" | sed -n '2,$p')"
|
||||
|
||||
test_expect_failure "$desc" \
|
||||
"ftp-parser --response '$response'"
|
||||
"ftp-parser --response \"$response\""
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
@ -74,6 +74,18 @@ test_ftp_response_expect_success \
|
||||
drwxrwxr-x folder 2 May 10 1996 network\r\n"
|
||||
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# EPLF response
|
||||
#
|
||||
|
||||
test_ftp_response_expect_success \
|
||||
'EPLF responses' \
|
||||
$'
|
||||
+i8388621.48594,m825718503,r,s280,\tdjb.html\r\n
|
||||
+i8388621.50690,m824255907,/,\t514\r\n
|
||||
+i8388621.48598,m824253270,r,s612,\t514.html\r\n'
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# Parser for VMS-style MultiNet (some spaces removed from examples)
|
||||
|
Loading…
Reference in New Issue
Block a user