From b3893e56edf93ce5e8f43a501843b2c1eecb64ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Tue, 22 Oct 2002 22:47:04 +0200
Subject: [PATCH] New test program.

Rev: src/nettle/examples/sexp-conv-test:1.1
---
 examples/sexp-conv-test | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 examples/sexp-conv-test

diff --git a/examples/sexp-conv-test b/examples/sexp-conv-test
new file mode 100755
index 00000000..1cabbd2f
--- /dev/null
+++ b/examples/sexp-conv-test
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+if [ -z "$srcdir" ] ; then
+  srcdir=`pwd`
+fi
+
+test_conv () {
+    # FIXME: echo -n not portable
+    echo -n "$1" > test.in
+    if ./sexp-conv <test.in >test1.out ; then
+	true
+    else
+	exit 1
+    fi
+    echo -n "$2" > test2.out
+
+    if cmp test1.out test2.out ; then
+	true
+    else
+	exit 1;
+    fi
+}
+
+test_conv "3:foo" "foo" -a
+test_conv "4:3des" '"3des"' -a
+test_conv "(3:foo [bar]foo)" "(3:foo[3:bar]3:foo)" -c
+
+exit 0
-- 
GitLab