Sha256: f0171de17fafc0883f78d26029c95433c2962170b88cfbf1ce72db69347830a4

Contents?: true

Size: 859 Bytes

Versions: 5

Compression:

Stored size: 859 Bytes

Contents

(examples-for ensure
  ("always gets called on the way out"
   (let x 10
     (ensure (assign x (+ x 11))
             (assign x (+ x 22)))
     x)
   43))

(examples-for on-err
  ("'handles errors"
   (let x nil
     (on-err (= x "impossible")
             (= x (nil nil nil)))
     x)
   "impossible")

  ("handles nested errors"
    (on-err (joinstr "\n" errors)
            (on-err (error "foo")
                    (on-err (error "bar")
                            (on-err (error "toto")
                                    (error "primum errorum")))))
    "foo
bar
toto
primum errorum")

  ("handles errors but any ensuring clause gets called first"
   (with (x nil y nil)
         (on-err (= x 'impossible)
                 (ensure (assign y 'ensure-clause)
                         (nil nil nil)))
         (list x y))
   (impossible ensure-clause)))

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nydp-0.6.0 lib/lisp/tests/error-tests.nydp
nydp-0.5.1 lib/lisp/tests/error-tests.nydp
nydp-0.5.0 lib/lisp/tests/error-tests.nydp
nydp-0.4.6 lib/lisp/tests/error-tests.nydp
nydp-0.4.5 lib/lisp/tests/error-tests.nydp