summaryrefslogtreecommitdiff
path: root/libmailutils/tests/url.at
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-09-15 00:38:16 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-09-15 00:48:22 +0300
commit548d50fb19cd66dbe153e4d7e879501bab58c0aa (patch)
tree15d314cb92ab33406233ffcf79f72461a7b2f280 /libmailutils/tests/url.at
parent7b79a6edcda94d4224bc4cbbe47cb6dcf2ea42db (diff)
downloadmailutils-548d50fb19cd66dbe153e4d7e879501bab58c0aa.tar.gz
mailutils-548d50fb19cd66dbe153e4d7e879501bab58c0aa.tar.bz2
Rewrite libmailutils testsuite in Autotest.
* configure.ac: Create libmailutils/tests/atlocal and libmailutils/tests/Makefile. Remove libmailutils/testsuite. * examples/Makefile.am (noinst_PROGRAMS): Remove programs moved to libmailutils/tests. * examples/argcv.c -> libmailutils/tests/argcv.c * libmailutils/testsuite/Decode -> libmailutils/tests/Decode * libmailutils/testsuite/Encode -> libmailutils/tests/Encode * examples/decode2047.c: Move to libmailutils/tests * examples/encode2047.c: Move to libmailutils/tests * examples/mailcap.c: Likewise. * examples/url-parse.c: Likewise. * include/mailutils/Makefile.am: Minor changes. * libmailutils/Makefile.am (SUBDIRS): Replace testsuite with tests. * libmailutils/tests/Makefile.am: New file. * libmailutils/tests/addr.c: New file. * libmailutils/tests/address.at: New file. * libmailutils/tests/argcv.at: New file. * libmailutils/tests/atlocal.in: New file. * libmailutils/tests/base64d.at: New file. * libmailutils/tests/base64e.at: New file. * libmailutils/tests/decode2047.at: New file. * libmailutils/tests/encode2047.at: New file. * libmailutils/tests/fltst.c: New file. * libmailutils/tests/mailcap.at: New file. * libmailutils/tests/mime.at: New file. * libmailutils/tests/testsuite.at: New file. * libmailutils/tests/url.at: New file. * libmailutils/testsuite/: Delete. * frm/tests/Makefile.am: Prefix package.m4 creation commands with $(AM_V_GEN). * readmsg/tests/Makefile.am: Likewise. * sieve/tests/Makefile.am: Likewise. * frm/tests/testsuite.at: Minor changes. * readmsg/tests/testsuite.at: Include testsuite.inc. * sieve/tests/testsuite.at: Likewise. * sieve/tests/version.at: Comment out inclusion of testsuite.inc. * testsuite/testsuite.inc: Add m4_version_prereq.
Diffstat (limited to 'libmailutils/tests/url.at')
-rw-r--r--libmailutils/tests/url.at776
1 files changed, 776 insertions, 0 deletions
diff --git a/libmailutils/tests/url.at b/libmailutils/tests/url.at
new file mode 100644
index 000000000..63a3c1c7a
--- /dev/null
+++ b/libmailutils/tests/url.at
@@ -0,0 +1,776 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
+# This file is part of Mailfromd testsuite.
+
+dnl ------------------------------------------------------------
+dnl TESTURL([NAME], [KW = `'], [INPUT], [STDOUT = `'],
+dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
+dnl
+m4_define([TESTURL],[
+AT_SETUP([URL: m4_if([$1],[],[$3],[$1])])
+AT_KEYWORDS([url $2])
+AT_CHECK([
+AT_DATA([input],[$3
+])
+url-parse < input],[0],m4_shift(m4_shift(m4_shift($@))))
+AT_CLEANUP
+])
+
+dnl ------------------------------------------------------------
+
+TESTURL([],[],
+[scheme:],
+[scheme <scheme>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[scheme:/absolute/path],
+[scheme <scheme>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </absolute/path>
+])
+
+TESTURL([],[],
+[scheme:relative/path],
+[scheme <scheme>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <relative/path>
+])
+
+TESTURL([],[],
+[scheme:///absolute/path],
+[scheme <scheme>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </absolute/path>
+])
+
+TESTURL([],[],
+[scheme://%75%73%65%72:%70%61%73%73@%68%6f%73%74],
+[scheme <scheme>
+user <user>
+passwd <pass>
+auth <>
+host <host>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[ftp://user:pass@host//a/path],
+[scheme <ftp>
+user <user>
+passwd <pass>
+auth <>
+host <host>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://:pass@host//a/path],
+[scheme <ftp>
+user <>
+passwd <pass>
+auth <>
+host <host>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://user:@host//a/path],
+[scheme <ftp>
+user <user>
+passwd <>
+auth <>
+host <host>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://user:pass@//a/path],
+[scheme <ftp>
+user <user>
+passwd <pass>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://user:@//a/path],
+[scheme <ftp>
+user <user>
+passwd <>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://:@host//a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <host>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://:pass@//a/path],
+[scheme <ftp>
+user <>
+passwd <pass>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://:@//a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://://a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://@//a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp:/a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[ftp://user:pass@host/a/path],
+[scheme <ftp>
+user <user>
+passwd <pass>
+auth <>
+host <host>
+port 0
+path <a/path>
+])
+
+
+TESTURL([],[],
+[ftp://:pass@host/a/path],
+[scheme <ftp>
+user <>
+passwd <pass>
+auth <>
+host <host>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://user:@host/a/path],
+[scheme <ftp>
+user <user>
+passwd <>
+auth <>
+host <host>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://user:pass@/a/path],
+[scheme <ftp>
+user <user>
+passwd <pass>
+auth <>
+host <>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://user:@/a/path],
+[scheme <ftp>
+user <user>
+passwd <>
+auth <>
+host <>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://:@host/a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <host>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://:pass@/a/path],
+[scheme <ftp>
+user <>
+passwd <pass>
+auth <>
+host <>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://:@/a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://:/a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp://@/a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <a/path>
+])
+
+TESTURL([],[],
+[ftp:///a/path],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </a/path>
+])
+
+TESTURL([],[],
+[pop://pop.example.net],
+[scheme <pop>
+user <>
+passwd <>
+auth <>
+host <pop.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[pop://user@pop.example.net],
+[scheme <pop>
+user <user>
+passwd <>
+auth <>
+host <pop.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[pop://user:passwd@pop.example.net],
+[scheme <pop>
+user <user>
+passwd <passwd>
+auth <>
+host <pop.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[pop://user;auth=*@pop.example.net],
+[scheme <pop>
+user <user>
+passwd <>
+auth <*>
+host <pop.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[pop://pop.example.net:111],
+[scheme <pop>
+user <>
+passwd <>
+auth <>
+host <pop.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[pop://user@pop.example.net:111],
+[scheme <pop>
+user <user>
+passwd <>
+auth <>
+host <pop.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[pop://user:passwd@pop.example.net:111],
+[scheme <pop>
+user <user>
+passwd <passwd>
+auth <>
+host <pop.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[pop://user;auth=*@pop.example.net:111],
+[scheme <pop>
+user <user>
+passwd <>
+auth <*>
+host <pop.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[imap://imap.example.net],
+[scheme <imap>
+user <>
+passwd <>
+auth <>
+host <imap.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[imap://user@imap.example.net],
+[scheme <imap>
+user <user>
+passwd <>
+auth <>
+host <imap.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[imap://user:passwd@imap.example.net],
+[scheme <imap>
+user <user>
+passwd <passwd>
+auth <>
+host <imap.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[imap://user;auth=*@imap.example.net],
+[scheme <imap>
+user <user>
+passwd <>
+auth <*>
+host <imap.example.net>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[imap://imap.example.net:111],
+[scheme <imap>
+user <>
+passwd <>
+auth <>
+host <imap.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[imap://user@imap.example.net:111],
+[scheme <imap>
+user <user>
+passwd <>
+auth <>
+host <imap.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[imap://user:passwd@imap.example.net:111],
+[scheme <imap>
+user <user>
+passwd <passwd>
+auth <>
+host <imap.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[imap://user;auth=*@imap.example.net:111],
+[scheme <imap>
+user <user>
+passwd <>
+auth <*>
+host <imap.example.net>
+port 111
+path <>
+])
+
+TESTURL([],[],
+[imap://imap.example.net/mbox],
+[scheme <imap>
+user <>
+passwd <>
+auth <>
+host <imap.example.net>
+port 0
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://user@imap.example.net/mbox],
+[scheme <imap>
+user <user>
+passwd <>
+auth <>
+host <imap.example.net>
+port 0
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://user:passwd@imap.example.net/mbox],
+[scheme <imap>
+user <user>
+passwd <passwd>
+auth <>
+host <imap.example.net>
+port 0
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://user;auth=*@imap.example.net/mbox],
+[scheme <imap>
+user <user>
+passwd <>
+auth <*>
+host <imap.example.net>
+port 0
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://imap.example.net:111/mbox],
+[scheme <imap>
+user <>
+passwd <>
+auth <>
+host <imap.example.net>
+port 111
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://user@imap.example.net:111/mbox],
+[scheme <imap>
+user <user>
+passwd <>
+auth <>
+host <imap.example.net>
+port 111
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://user:passwd@imap.example.net:111/mbox],
+[scheme <imap>
+user <user>
+passwd <passwd>
+auth <>
+host <imap.example.net>
+port 111
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://user;auth=*@imap.example.net:111/mbox],
+[scheme <imap>
+user <user>
+passwd <>
+auth <*>
+host <imap.example.net>
+port 111
+path <mbox>
+])
+
+TESTURL([],[],
+[imap://imap.example.net/mbox/user@host],
+[scheme <imap>
+user <imap.example.net/mbox/user>
+passwd <>
+auth <>
+host <host>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[imap://user@imap.example.net/mbox/user@host],
+[scheme <imap>
+user <user>
+passwd <>
+auth <>
+host <imap.example.net>
+port 0
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[imap://user:passwd@imap.example.net/mbox/user@host],
+[scheme <imap>
+user <user>
+passwd <passwd>
+auth <>
+host <imap.example.net>
+port 0
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[imap://user;auth=*@imap.example.net/mbox/user@host],
+[scheme <imap>
+user <user>
+passwd <>
+auth <*>
+host <imap.example.net>
+port 0
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[imap://imap.example.net:111/mbox/user@host],
+[scheme <imap>
+user <imap.example.net>
+passwd <111/mbox/user>
+auth <>
+host <host>
+port 0
+path <>
+])
+
+TESTURL([],[],
+[imap://user@imap.example.net:111/mbox/user@host],
+[scheme <imap>
+user <user>
+passwd <>
+auth <>
+host <imap.example.net>
+port 111
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[imap://user:passwd@imap.example.net:111/mbox/user@host],
+[scheme <imap>
+user <user>
+passwd <passwd>
+auth <>
+host <imap.example.net>
+port 111
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[imap://user;auth=*@imap.example.net:111/mbox/user@host],
+[scheme <imap>
+user <user>
+passwd <>
+auth <*>
+host <imap.example.net>
+port 111
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[ftp://ftp.example.org/mbox/user%40host],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <ftp.example.org>
+port 0
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[ftp://ftp.example.org:111/mbox/user%40host],
+[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <ftp.example.org>
+port 111
+path <mbox/user@host>
+])
+
+TESTURL([],[],
+[ftp://ftp.example.org:111/mbox/user%40host;type=pass],
+[[scheme <ftp>
+user <>
+passwd <>
+auth <>
+host <ftp.example.org>
+port 111
+path <mbox/user@host>
+param[0] <type=pass>
+]])
+
+TESTURL([],[],
+[mbox:/var/spool/mail;type=index;param=2;user=gray],
+[[scheme <mbox>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </var/spool/mail>
+param[0] <type=index>
+param[1] <param=2>
+param[2] <user=gray>
+]])
+
+TESTURL([],[],
+[mbox:///var/spool/mail;type=index;param=2;user=gray],
+[[scheme <mbox>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </var/spool/mail>
+param[0] <type=index>
+param[1] <param=2>
+param[2] <user=gray>
+]])
+
+TESTURL([],[],
+[http://gnu.org.ua/home/gray?prog&arg1&arg2],
+[[scheme <http>
+user <>
+passwd <>
+auth <>
+host <gnu.org.ua>
+port 0
+path <home/gray>
+query[0] <prog>
+query[1] <arg1>
+query[2] <arg2>
+]])
+
+TESTURL([],[],
+[http://gnu.org.ua/home/gray;foo=bar;baz=qux?prog&arg%201&arg%202],
+[[scheme <http>
+user <>
+passwd <>
+auth <>
+host <gnu.org.ua>
+port 0
+path <home/gray>
+param[0] <foo=bar>
+param[1] <baz=qux>
+query[0] <prog>
+query[1] <arg 1>
+query[2] <arg 2>
+]])
+
+

Return to:

Send suggestions and report system problems to the System administrator.