summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-02-24 23:33:20 +0100
committerAndy Wingo <wingo@pobox.com>2010-02-24 23:33:20 +0100
commitce4c9a6d00a647892e25d24d703f328afb4be9c3 (patch)
treebcd5d17e7302e92c7717140d5c2abad6b76cb572
parent0404c97dc904272ec8a55cacbe639dc52de2830e (diff)
downloadguile-ce4c9a6d00a647892e25d24d703f328afb4be9c3.tar.gz
start of tests for (ice-9 control)
* test-suite/Makefile.am: * test-suite/tests/control.test: Add the beginnings of a delimited continuations test suite.
-rw-r--r--test-suite/Makefile.am1
-rw-r--r--test-suite/tests/control.test46
2 files changed, 47 insertions, 0 deletions
diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
index 3d6bf80cd..36afa2560 100644
--- a/test-suite/Makefile.am
+++ b/test-suite/Makefile.am
@@ -31,6 +31,7 @@ SCM_TESTS = tests/alist.test \
tests/c-api.test \
tests/chars.test \
tests/common-list.test \
+ tests/control.test \
tests/continuations.test \
tests/elisp.test \
tests/elisp-compiler.test \
diff --git a/test-suite/tests/control.test b/test-suite/tests/control.test
new file mode 100644
index 000000000..fab2f6092
--- /dev/null
+++ b/test-suite/tests/control.test
@@ -0,0 +1,46 @@
+;;;; -*- scheme -*-
+;;;; control.test --- test suite for delimited continuations
+;;;;
+;;;; Copyright (C) 2010 Free Software Foundation, Inc.
+;;;;
+;;;; This library is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
+;;;;
+;;;; This library 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
+;;;; Lesser General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+(define-module (test-suite test-control)
+ #:use-module (ice-9 control)
+ #:use-module (test-suite lib))
+
+
+(define default-tag (fluid-ref %default-prompt-tag))
+
+
+(with-test-prefix "escape-only continuations"
+ (pass-if "no values, normal exit"
+ (equal? '()
+ (call-with-values
+ (lambda ()
+ (% default-tag
+ (values)
+ (lambda (k . args)
+ (error "unexpected exit" args))))
+ list)))
+ (pass-if "no values, normal exit"
+ (equal? '()
+ (% default-tag
+ (begin
+ (abort default-tag)
+ (error "unexpected exit"))
+ (lambda (k . args)
+ args)))))
+