2019-10-18 09:05:08 -04:00
|
|
|
IN: temporary
|
2019-10-18 09:05:06 -04:00
|
|
|
USING: arrays byte-arrays kernel kernel-internals math memory
|
2019-10-18 09:05:08 -04:00
|
|
|
namespaces sequences test errors math-internals
|
|
|
|
|
quotations ;
|
2005-08-12 18:02:03 -04:00
|
|
|
|
|
|
|
|
[ 0 ] [ f size ] unit-test
|
2005-09-18 01:37:28 -04:00
|
|
|
[ t ] [ [ \ = \ = ] all-equal? ] unit-test
|
2005-12-12 20:53:55 -05:00
|
|
|
|
2006-11-01 00:25:01 -05:00
|
|
|
! Don't leak extra roots if error is thrown
|
|
|
|
|
[ ] [ 10000 [ [ -1 f <array> ] catch drop ] times ] unit-test
|
|
|
|
|
|
2006-01-26 23:01:14 -05:00
|
|
|
[ t ] [ cell integer? ] unit-test
|
|
|
|
|
[ t ] [ bootstrap-cell integer? ] unit-test
|
2006-08-30 03:50:02 -04:00
|
|
|
|
|
|
|
|
[ [ 3 ] ] [ 3 f curry ] unit-test
|
|
|
|
|
[ [ \ + ] ] [ \ + f curry ] unit-test
|
|
|
|
|
[ [ \ + = ] ] [ \ + [ = ] curry ] unit-test
|
2006-10-06 20:27:40 -04:00
|
|
|
|
|
|
|
|
! Make sure we report the correct error on stack underflow
|
|
|
|
|
[ { kernel-error 11 f f } ]
|
|
|
|
|
[ [ clear drop ] catch ] unit-test
|
2019-10-18 09:05:04 -04:00
|
|
|
|
2019-10-18 09:05:06 -04:00
|
|
|
[ { kernel-error 13 f f } ]
|
|
|
|
|
[ [ V{ } set-retainstack r> ] catch ] unit-test
|
|
|
|
|
|
|
|
|
|
: overflow-d 3 overflow-d ;
|
|
|
|
|
|
|
|
|
|
[ { kernel-error 12 f f } ]
|
|
|
|
|
[ [ overflow-d ] catch ] unit-test
|
|
|
|
|
|
|
|
|
|
: overflow-r 3 >r overflow-r ;
|
|
|
|
|
|
|
|
|
|
[ { kernel-error 14 f f } ]
|
|
|
|
|
[ [ overflow-r ] catch ] unit-test
|
|
|
|
|
|
2019-10-18 09:05:08 -04:00
|
|
|
! [ { kernel-error 15 f f } ]
|
|
|
|
|
! [ [ V{ } set-callstack ] catch ] unit-test
|
2019-10-18 09:05:06 -04:00
|
|
|
|
|
|
|
|
: overflow-c overflow-c 3 ;
|
|
|
|
|
|
|
|
|
|
[ { kernel-error 16 f f } ]
|
|
|
|
|
[ [ overflow-c ] catch ] unit-test
|
|
|
|
|
|
2019-10-18 09:05:04 -04:00
|
|
|
[ -7 <byte-array> ] unit-test-fails
|
2019-10-18 09:05:06 -04:00
|
|
|
|
|
|
|
|
[ 2 3 4 1 ] [ 1 2 3 4 roll ] unit-test
|
|
|
|
|
[ 1 2 3 4 ] [ 2 3 4 1 -roll ] unit-test
|
|
|
|
|
|
|
|
|
|
[ 3 ] [ t 3 and ] unit-test
|
|
|
|
|
[ f ] [ f 3 and ] unit-test
|
|
|
|
|
[ f ] [ 3 f and ] unit-test
|
|
|
|
|
[ 4 ] [ 4 6 or ] unit-test
|
|
|
|
|
[ 6 ] [ f 6 or ] unit-test
|
|
|
|
|
|
|
|
|
|
! some primitives are missing GC checks
|
|
|
|
|
! these tests take a long time to run and they have dubious value
|
|
|
|
|
! we always GC check in allot() now
|
|
|
|
|
|
|
|
|
|
! [ ] [ 1000000 [ drop H{ } clone >n n> drop ] each ] unit-test
|
|
|
|
|
! [ ] [ 1.0 1000000 [ 1.0 * ] times drop ] unit-test
|
|
|
|
|
! [ ] [ 268435455 >fixnum 1000000 [ dup dup + drop ] times drop ] unit-test
|
|
|
|
|
! [ ] [ 268435455 >fixnum 1000000 [ dup dup fixnum+ drop ] times drop ] unit-test
|
|
|
|
|
! [ ] [ 1000000 [ drop 1/3 >fixnum drop ] each ] unit-test
|
|
|
|
|
! [ ] [ 1000000 [ drop 1/3 >bignum drop ] each ] unit-test
|
|
|
|
|
! [ ] [ 1000000 [ drop 1/3 >float drop ] each ] unit-test
|