diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-03-02 10:39:01 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-03-02 10:39:01 +0000 |
commit | 7ede0a84a0299df64231d1b0a58cd4d89bf4cd42 (patch) | |
tree | f328886c5bb6fbf5ce838e536112338dd1add4b3 | |
parent | faaf8f30d27f90cb01cce52566919caf0bee34a3 (diff) | |
download | mailfromd-7ede0a84a0299df64231d1b0a58cd4d89bf4cd42.tar.gz mailfromd-7ede0a84a0299df64231d1b0a58cd4d89bf4cd42.tar.bz2 |
Add testcases from the trunk
git-svn-id: file:///svnroot/mailfromd/branches/release_3_1_patches@1273 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | testsuite/etc/sa01.rc | 24 | ||||
-rw-r--r-- | testsuite/etc/sa02.rc | 24 | ||||
-rw-r--r-- | testsuite/etc/sa03.rc | 29 | ||||
-rw-r--r-- | testsuite/etc/sa04.rc | 29 | ||||
-rw-r--r-- | testsuite/mailfromd/functx.exp | 34 |
5 files changed, 140 insertions, 0 deletions
diff --git a/testsuite/etc/sa01.rc b/testsuite/etc/sa01.rc new file mode 100644 index 00000000..f44eccfe --- /dev/null +++ b/testsuite/etc/sa01.rc @@ -0,0 +1,24 @@ +# This file is part of Mailfromd +# Copyright (C) 2007 Sergey Poznyakoff +# +# Mailfromd 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 2 of the License, or +# (at your option) any later version. +# +# Mailfromd 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 Mailfromd; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +prog envfrom +do + if sa("tcp://localhost", 10) + discard + fi +done diff --git a/testsuite/etc/sa02.rc b/testsuite/etc/sa02.rc new file mode 100644 index 00000000..d01dc34c --- /dev/null +++ b/testsuite/etc/sa02.rc @@ -0,0 +1,24 @@ +# This file is part of Mailfromd +# Copyright (C) 2007 Sergey Poznyakoff +# +# Mailfromd 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 2 of the License, or +# (at your option) any later version. +# +# Mailfromd 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 Mailfromd; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +prog eom +do + if sa("tcp://localhost", 10) + discard + fi +done diff --git a/testsuite/etc/sa03.rc b/testsuite/etc/sa03.rc new file mode 100644 index 00000000..3f9df51f --- /dev/null +++ b/testsuite/etc/sa03.rc @@ -0,0 +1,29 @@ +# This file is part of Mailfromd +# Copyright (C) 2007 Sergey Poznyakoff +# +# Mailfromd 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 2 of the License, or +# (at your option) any later version. +# +# Mailfromd 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 Mailfromd; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +func sa_wrap(string url) +do + if sa(%url, 3) + discard + fi +done + +prog envfrom +do + sa_wrap("tcp://localhost") +done diff --git a/testsuite/etc/sa04.rc b/testsuite/etc/sa04.rc new file mode 100644 index 00000000..593de5d0 --- /dev/null +++ b/testsuite/etc/sa04.rc @@ -0,0 +1,29 @@ +# This file is part of Mailfromd +# Copyright (C) 2007 Sergey Poznyakoff +# +# Mailfromd 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 2 of the License, or +# (at your option) any later version. +# +# Mailfromd 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 Mailfromd; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +func sa_wrap(string url) +do + if sa(%url, 3) + discard + fi +done + +prog eom +do + sa_wrap("tcp://localhost") +done diff --git a/testsuite/mailfromd/functx.exp b/testsuite/mailfromd/functx.exp new file mode 100644 index 00000000..2a09cd40 --- /dev/null +++ b/testsuite/mailfromd/functx.exp @@ -0,0 +1,34 @@ +# -*- tcl -*- +# This file is part of Mailfromd testsuite. +# Copyright (C) 2007 Sergey Poznyakoff +# +# Mailfromd 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 2 of the License, or +# (at your option) any later version. +# +# Mailfromd 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 Mailfromd; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +set MAILFROMD_TOOL_FLAGS "--lint" + +mailfromd_exec -message "Builtin in wrong context" -retcode 78 \ + -arg "$MAILFROMD_ETC_DIR/sa01.rc" \ + "mailfromd: $MAILFROMD_ETC_DIR/sa01.rc:21: Built-in function `sa' cannot be used in prog `envfrom'" + +mailfromd_exec -message "Builtin in correct context" \ + -arg "$MAILFROMD_ETC_DIR/sa02.rc" + +mailfromd_exec -message "Function in wrong context" -retcode 78 \ + -arg "$MAILFROMD_ETC_DIR/sa03.rc" \ + "mailfromd: $MAILFROMD_ETC_DIR/sa03.rc:29: Function `sa_wrap' cannot be used in prog `envfrom'" + +mailfromd_exec -message "Function in correct context" \ + -arg "$MAILFROMD_ETC_DIR/sa04.rc" + |