summaryrefslogtreecommitdiff
path: root/examples/box-module/check.test
diff options
context:
space:
mode:
Diffstat (limited to 'examples/box-module/check.test')
-rwxr-xr-xexamples/box-module/check.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/box-module/check.test b/examples/box-module/check.test
new file mode 100755
index 000000000..28a79d45b
--- /dev/null
+++ b/examples/box-module/check.test
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# must be run from this directory
+guile=${GUILE-../../libguile/guile}
+
+set -e
+
+#
+# ./box test #1
+#
+./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP
+cat <<EOF | diff -u - TMP
+#<box #f>
+EOF
+rm -f TMP
+
+#
+# ./box test #2
+#
+./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
+cat <<EOF | diff -u - TMP
+#<box #f>
+#<box 1>
+EOF
+rm -f TMP
+
+#
+# ./box test #3
+#
+./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
+cat <<EOF | diff -u - TMP
+#<box #f>
+#<box 1>
+1
+EOF
+rm -f TMP
+
+# check.test ends here