[Pkg-wmaker-commits] [wmbiff] 47/77: add tests for bbacktick expansion
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:01:12 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to tag wmbiff_0_4_0
in repository wmbiff.
commit 7e52822032d4ee0676a08379b79ae6f07ed2c9d9
Author: bluehal <bluehal>
Date: Sat Apr 20 07:50:34 2002 +0000
add tests for bbacktick expansion
---
wmbiff/Makefile.am | 3 +++
wmbiff/test_wmbiff.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/wmbiff/Makefile.am b/wmbiff/Makefile.am
index 6a1eb6b..e412b4c 100644
--- a/wmbiff/Makefile.am
+++ b/wmbiff/Makefile.am
@@ -1,9 +1,12 @@
+noinst_PROGRAMS = test_wmbiff
bin_PROGRAMS = wmbiff
wmbiff_SOURCES = wmbiff.c socket.c Pop3Client.c LicqClient.c mboxClient.c \
maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c \
passwordMgr.c passwordMgr.h charutil.c charutil.h Client.h
wmbiff_LDADD = -L../wmgeneral -lwmgeneral
wmbiff_DEPENDENCIES = ../wmgeneral/libwmgeneral.a
+test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \
+ test_wmbiff.c
man_MANS = wmbiff.1 wmbiffrc.5
skindir = $(datadir)/wmbiff/skins
skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm
diff --git a/wmbiff/test_wmbiff.c b/wmbiff/test_wmbiff.c
new file mode 100644
index 0000000..e6a70ec
--- /dev/null
+++ b/wmbiff/test_wmbiff.c
@@ -0,0 +1,49 @@
+#include "Client.h"
+
+int debug_default = DEBUG_INFO;
+
+int test_backtickExpand(void) {
+ const char *tests[] =
+ { "prefix`echo 1`suffix",
+ "prefix`echo 1`",
+ "`echo 1`",
+ "`echo a b` c",
+ "`false`",
+ NULL };
+ const char *solns[] =
+ { "prefix1suffix",
+ "prefix1",
+ "1",
+ "a b c",
+ "",
+ NULL };
+ int i;
+ int retval = 0;
+ for(i=0; tests[i]!=NULL; i++) {
+ char *x = backtickExpand(NULL, tests[i]);
+ if(strcmp(x, solns[i]) != 0) {
+ printf("test failed: [%s] != [%s]\n",
+ tests[i], solns[i]);
+ retval = 1;
+ }
+ free(x);
+ }
+ printf("backtick tests complete\n");
+ return(retval);
+}
+
+int main(int argc __attribute__((unused)),
+ char *argv[] __attribute__((unused))) {
+ exit( test_backtickExpand() );
+}
+
+/* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git
More information about the Pkg-wmaker-commits
mailing list