]> gitweb.factorcode.org Git - factor.git/blob - core/memory/memory-tests.factor
1c23e700ca0c661a89615faff135c41335bb15ab
[factor.git] / core / memory / memory-tests.factor
1 USING: generic kernel kernel.private math memory prettyprint io
2 sequences tools.test words namespaces layouts classes
3 classes.builtin arrays quotations ;
4 IN: memory.tests
5
6 [ [ ] instances ] must-infer
7
8 ! Code GC wasn't kicking in when needed
9 : leak-step 800000 f <array> 1quotation call drop ;
10
11 : leak-loop 100 [ leak-step ] times ;
12
13 [ ] [ leak-loop ] unit-test
14
15 TUPLE: testing x y z ;
16
17 [ save-image-and-exit ] must-fail
18
19 [ ] [
20     num-types get [
21         type>class [
22             dup . flush
23             "predicate" word-prop instances [
24                 class drop
25             ] each
26         ] when*
27     ] each
28 ] unit-test
29
30 ! Erg's bug
31 2 [ [ [ 3 throw ] instances ] must-fail ] times