factor/library/test/errors.factor

43 lines
765 B
Factor
Raw Normal View History

IN: temporary
USE: sequences
2004-08-16 21:11:27 -04:00
USE: errors
USE: kernel
USE: namespaces
USE: test
2004-11-25 23:14:17 -05:00
USE: parser
USE: io
2005-09-17 22:25:18 -04:00
USE: memory
2004-08-16 21:11:27 -04:00
[ clear drop ] unit-test-fails
[ f ] [ [ ] catch ] unit-test
2004-08-16 21:11:27 -04:00
[ 5 ] [ [ 5 throw ] catch ] unit-test
2004-08-16 21:11:27 -04:00
[ t ] [
[ "Hello" throw ] catch drop
2005-09-27 00:24:42 -04:00
global [ error get ] bind
2004-08-16 21:11:27 -04:00
"Hello" =
] unit-test
2004-11-25 20:37:05 -05:00
2004-11-25 23:14:17 -05:00
"!!! The following error is part of the test" print
2004-12-25 21:28:47 -05:00
[ ] [ [ 6 [ 12 [ "2 car" ] ] ] print-error ] unit-test
2004-11-25 23:14:17 -05:00
"!!! The following error is part of the test" print
[ [ "2 car" ] parse ] catch print-error
2005-09-28 23:29:00 -04:00
[ f throw ] unit-test-fails
! See how well callstack overflow is handled
: callstack-overflow callstack-overflow f ;
[ callstack-overflow ] unit-test-fails
! Weird PowerPC bug.
[ ] [
[ "4" throw ] catch drop
full-gc
full-gc
] unit-test