factor/library/test/errors.factor

30 lines
559 B
Factor
Raw Normal View History

IN: temporary
2004-08-16 21:11:27 -04:00
USE: errors
USE: kernel
USE: namespaces
USE: test
2004-11-25 20:37:05 -05:00
USE: lists
2004-11-25 23:14:17 -05:00
USE: parser
USE: stdio
2004-08-16 21:11:27 -04:00
[ f ] [ [ ] [ ] catch ] unit-test
[ 5 ] [ [ 5 throw ] [ ] catch ] unit-test
[ t ] [
[ "Hello" throw ] [ drop ] catch
global [ "error" get ] bind
"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
2004-12-25 21:28:47 -05:00
[ [ "2 car" ] parse ] [ print-error ] catch
! This should not raise an error
2005-04-05 22:18:36 -04:00
[ 1 2 3 ] [ 1 2 3 f throw ] unit-test