mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-23 21:10:29 +02:00
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.
This commit is contained in:
parent
0404c97dc9
commit
ce4c9a6d00
2 changed files with 47 additions and 0 deletions
|
@ -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 \
|
||||
|
|
46
test-suite/tests/control.test
Normal file
46
test-suite/tests/control.test
Normal file
|
@ -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)))))
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue