2007-10-06 13:37:11 -04:00
|
|
|
USING: destructors kernel tools.test continuations ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: temporary
|
|
|
|
|
|
|
|
TUPLE: dummy-obj destroyed? ;
|
|
|
|
|
|
|
|
: <dummy-obj>
|
|
|
|
\ dummy-obj construct-empty ;
|
|
|
|
|
|
|
|
[ t ] [
|
|
|
|
[
|
|
|
|
<dummy-obj>
|
|
|
|
dup [ t swap set-dummy-obj-destroyed? ] t add-destructor
|
|
|
|
] with-destructors dummy-obj-destroyed?
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ f ] [
|
|
|
|
[
|
|
|
|
<dummy-obj>
|
|
|
|
dup [ t swap set-dummy-obj-destroyed? ] f add-destructor
|
|
|
|
] with-destructors dummy-obj-destroyed?
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ t ] [
|
|
|
|
<dummy-obj> [
|
|
|
|
[
|
|
|
|
dup [ t swap set-dummy-obj-destroyed? ] t add-destructor
|
|
|
|
"foo" throw
|
|
|
|
] with-destructors
|
|
|
|
] catch drop dummy-obj-destroyed?
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ t ] [
|
|
|
|
<dummy-obj> [
|
|
|
|
[
|
|
|
|
dup [ t swap set-dummy-obj-destroyed? ] f add-destructor
|
|
|
|
"foo" throw
|
|
|
|
] with-destructors
|
|
|
|
] catch drop dummy-obj-destroyed?
|
|
|
|
] unit-test
|
|
|
|
|