/[guile]/guile/guile-core/test-suite/tests/dynamic-scope.test
ViewVC logotype

Diff of /guile/guile-core/test-suite/tests/dynamic-scope.test

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mvo, Sat Aug 25 16:05:37 2001 UTC revision 1.2 by dirk, Tue Oct 7 22:00:05 2003 UTC
# Line 18  Line 18 
18  ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,  ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19  ;;;; Boston, MA 02111-1307 USA  ;;;; Boston, MA 02111-1307 USA
20    
21  (use-modules (test-suite lib))  (define-module (test-suite test-dynamic-scope)
22      :use-module (test-suite lib))
23    
24    
25    (define exception:duplicate-binding
26      (cons 'misc-error "^duplicate bindings"))
27    (define exception:bad-binding
28      (cons 'misc-error "^bad bindings"))
29    
30  (define global-a 0)  (define global-a 0)
31  (define (fetch-global-a) global-a)  (define (fetch-global-a) global-a)
# Line 35  Line 42 
42        (= global-a 0)))        (= global-a 0)))
43    
44    (pass-if-exception "duplicate @binds"    (pass-if-exception "duplicate @binds"
45      (cons 'misc-error "^duplicate bindings")      exception:duplicate-binding
46      (@bind ((a 1) (a 2)) (+ a a)))      (eval '(@bind ((a 1) (a 2)) (+ a a))
47              (interaction-environment)))
48    
49    (pass-if-exception "@bind missing expression"    (pass-if-exception "@bind missing expression"
50      (cons 'misc-error "^missing or extra expression")      exception:missing-expression
51      (@bind ((global-a 1))))      (eval '(@bind ((global-a 1)))
52              (interaction-environment)))
53    
54    (pass-if-exception "@bind bad bindings"    (pass-if-exception "@bind bad bindings"
55      (cons 'misc-error "^bad bindings")      exception:bad-binding
56      (@bind (a) #f))      (eval '(@bind (a) #f)
57              (interaction-environment)))
58    
59    (pass-if-exception "@bind bad bindings"    (pass-if-exception "@bind bad bindings"
60      (cons 'misc-error "^bad bindings")      exception:bad-binding
61      (@bind ((a)) #f))      (eval '(@bind ((a)) #f)
62              (interaction-environment)))
63    
64    (pass-if "@bind and dynamic-wind"    (pass-if "@bind and dynamic-wind"
65      (letrec ((co-routine #f)      (letrec ((co-routine #f)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26