Use windows-1252 encoding for stdin/stdout on Windows
[factor/jcg.git] / core / memory / memory-tests.factor
blob11a6a9d8a991a1247219bf8ebb20b64a9739c9c0
1 USING: generic kernel kernel.private math memory prettyprint io
2 sequences tools.test words namespaces layouts classes
3 classes.builtin arrays quotations io.launcher system ;
4 IN: memory.tests
6 ! LOL
7 [ ] [
8     vm
9     "-i=" image append
10     "-generations=2"
11     "-e=USING: memory io prettyprint system ; input-stream gc . 0 exit"
12     4array try-process
13 ] unit-test
15 [ [ ] instances ] must-infer
17 ! Code GC wasn't kicking in when needed
18 : leak-step 800000 f <array> 1quotation call drop ;
20 : leak-loop 100 [ leak-step ] times ;
22 [ ] [ leak-loop ] unit-test
24 TUPLE: testing x y z ;
26 [ save-image-and-exit ] must-fail
28 [ ] [
29     num-types get [
30         type>class [
31             dup . flush
32             "predicate" word-prop instances [
33                 class drop
34             ] each
35         ] when*
36     ] each
37 ] unit-test
39 ! Erg's bug
40 2 [ [ [ 3 throw ] instances ] must-fail ] times