]> gitweb.factorcode.org Git - factor.git/blob - core/test/kernel.factor
b6cb453eb8b52b4cab99d0aca59749f59bb9f54a
[factor.git] / core / test / kernel.factor
1 IN: scratchpad
2 USING: arrays kernel kernel-internals math memory namespaces
3 sequences test errors math-internals ;
4
5 [ 0 ] [ f size ] unit-test
6 [ t ] [ [ \ = \ = ] all-equal? ] unit-test
7
8 ! some primitives are missing GC checks
9 [ ] [ 1000000 [ drop H{ } clone >n n> drop ] each ] unit-test
10 [ ] [ 1.0 10000000 [ 1.0 * ] times drop ] unit-test
11 [ ] [ 268435455 >fixnum 10000000 [ dup dup + drop ] times drop ] unit-test
12 [ ] [ 268435455 >fixnum 10000000 [ dup dup fixnum+ drop ] times drop ] unit-test
13 [ ] [ 10000000 [ drop 1/3 >fixnum drop ] each ] unit-test
14 [ ] [ 10000000 [ drop 1/3 >bignum drop ] each ] unit-test
15 [ ] [ 10000000 [ drop 1/3 >float drop ] each ] unit-test
16
17 ! Don't leak extra roots if error is thrown
18 [ ] [ 10000 [ [ -1 f <array> ] catch drop ] times ] unit-test
19
20 [ t ] [ cell integer? ] unit-test
21 [ t ] [ bootstrap-cell integer? ] unit-test
22
23 [ [ 3 ] ] [ 3 f curry ] unit-test
24 [ [ \ + ] ] [ \ + f curry ] unit-test
25 [ [ \ + = ] ] [ \ + [ = ] curry ] unit-test
26
27 ! Make sure we report the correct error on stack underflow
28 [ { kernel-error 12 f f } ]
29 [ [ clear drop ] catch ] unit-test
30
31 [ -7 <byte-array> ] unit-test-fails