factor/library/test/crashes.factor

58 lines
1.3 KiB
Factor
Raw Normal View History

2004-08-10 00:58:52 -04:00
IN: scratchpad
USE: errors
2004-08-10 00:58:52 -04:00
USE: kernel
2004-08-27 02:09:24 -04:00
USE: math
2004-08-10 00:58:52 -04:00
USE: namespaces
USE: parser
USE: stack
2004-08-10 00:58:52 -04:00
USE: strings
USE: test
2004-08-27 02:09:24 -04:00
USE: vectors
2004-09-20 21:02:48 -04:00
USE: lists
2004-08-10 00:58:52 -04:00
! Various things that broke CFactor at various times.
2004-08-10 00:58:52 -04:00
! This should run without issue (and tests nothing useful)
! in Java Factor
"20 <sbuf> \"foo\" set" eval
"garbage-collection" eval
[
[ drop ] [ drop ] catch
[ drop ] [ drop ] catch
] keep-datastack
2004-08-27 02:09:24 -04:00
"hello" str>sbuf "x" set
[ -5 "x" get set-sbuf-length ] [ drop ] catch
2004-08-27 23:20:10 -04:00
[ "x" get sbuf>str drop ] [ drop ] catch
2004-08-27 02:09:24 -04:00
10 <vector> "x" set
[ -2 "x" get set-vector-length ] [ drop ] catch
[ "x" get vector-clone drop ] [ drop ] catch
2004-08-27 02:09:24 -04:00
10 [ [ -1000000 <vector> ] [ drop ] catch ] times
10 [ [ -1000000 <sbuf> ] [ drop ] catch ] times
2004-09-20 21:02:48 -04:00
! Make sure various type checks don't run into header untagging
! problems etc.
! Lotype -vs- lotype
[ ] [ [ 4 car ] [ drop ] catch ] unit-test
! Lotype -vs- hitype
[ ] [ [ 4 vector-length ] [ drop ] catch ] unit-test
[ ] [ [ [ 4 3 ] vector-length ] [ drop ] catch ] unit-test
! Hitype -vs- lotype
[ ] [ [ "hello" car ] [ drop ] catch ] unit-test
! Hitype -vs- hitype
[ ] [ [ "hello" vector-length ] [ drop ] catch ] unit-test
! f -vs- lotype
[ ] [ [ f car ] [ drop ] catch ] unit-test
! f -vs- hitype
[ ] [ [ f vector-length ] [ drop ] catch ] unit-test