]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/redefine5.factor
b027230a481c29895f2d59e0924fb48c1a2714fd
[factor.git] / basis / compiler / tests / redefine5.factor
1 USING: eval tools.test compiler.units vocabs words kernel ;
2 IN: compiler.tests.redefine5
3
4 ! Regression: if dispatch was eliminated but method was not inlined,
5 ! compiled usage information was not recorded.
6
7 [ "compiler.tests.redefine5" forget-vocab ] with-compilation-unit
8
9 [ ] [
10     "USING: sorting kernel math.order ;
11     IN: compiler.tests.redefine5
12     GENERIC: my-generic ( a -- b )
13     M: object my-generic [ <=> ] sort ;
14     : my-inline ( a -- b ) my-generic ;"
15     eval( -- )
16 ] unit-test
17
18 [ ] [
19     "USE: kernel
20     IN: compiler.tests.redefine5
21     TUPLE: my-tuple ;
22     M: my-tuple my-generic drop 0 ;" eval( -- )
23 ] unit-test
24
25 [ 0 ] [
26     "my-tuple" "compiler.tests.redefine5" lookup-word boa
27     "my-inline" "compiler.tests.redefine5" lookup-word execute
28 ] unit-test