1 USING: accessors compiler compiler.units tools.test math parser
2 kernel sequences sequences.private classes.mixin generic
3 definitions arrays words assocs eval ;
6 GENERIC: method-redefine-test ( a -- b )
8 M: integer method-redefine-test 3 + ;
10 : method-redefine-test-1 ( -- b ) 3 method-redefine-test ;
12 [ 6 ] [ method-redefine-test-1 ] unit-test
14 [ ] [ "IN: compiler.tests USE: math M: fixnum method-redefine-test 4 + ;" eval ] unit-test
16 [ 7 ] [ method-redefine-test-1 ] unit-test
18 [ ] [ [ fixnum \ method-redefine-test method forget ] with-compilation-unit ] unit-test
20 [ 6 ] [ method-redefine-test-1 ] unit-test
22 ! Test ripple-up behavior
26 [ t ] [ \ hey optimized>> ] unit-test
27 [ t ] [ \ there optimized>> ] unit-test
28 [ ] [ "IN: compiler.tests : hey ( -- ) 3 ;" eval ] unit-test
29 [ f ] [ \ hey optimized>> ] unit-test
30 [ f ] [ \ there optimized>> ] unit-test
31 [ ] [ "IN: compiler.tests : hey ( -- ) ;" eval ] unit-test
32 [ t ] [ \ there optimized>> ] unit-test
38 [ t ] [ \ good optimized>> ] unit-test
39 [ t ] [ \ bad optimized>> ] unit-test
40 [ t ] [ \ ugly optimized>> ] unit-test
42 [ f ] [ \ good compiled-usage assoc-empty? ] unit-test
44 [ ] [ "IN: compiler.tests : good ( -- ) 3 ;" eval ] unit-test
46 [ f ] [ \ good optimized>> ] unit-test
47 [ f ] [ \ bad optimized>> ] unit-test
48 [ f ] [ \ ugly optimized>> ] unit-test
50 [ t ] [ \ good compiled-usage assoc-empty? ] unit-test
52 [ ] [ "IN: compiler.tests : good ( -- ) ;" eval ] unit-test
54 [ t ] [ \ good optimized>> ] unit-test
55 [ t ] [ \ bad optimized>> ] unit-test
56 [ t ] [ \ ugly optimized>> ] unit-test
58 [ f ] [ \ good compiled-usage assoc-empty? ] unit-test