factor/core/definitions/definitions-tests.factor

52 lines
847 B
Factor
Raw Normal View History

2007-10-09 17:35:09 -04:00
IN: temporary
2008-01-09 19:13:26 -05:00
USING: tools.test generic kernel definitions sequences
compiler.units ;
2007-10-09 17:35:09 -04:00
TUPLE: combination-1 ;
M: combination-1 perform-combination 2drop { } [ ] each [ ] ;
SYMBOL: generic-1
2007-12-24 19:40:09 -05:00
[
generic-1 T{ combination-1 } define-generic
2007-10-09 17:35:09 -04:00
2007-12-24 19:40:09 -05:00
[ ] <method> object \ generic-1 define-method
] with-compilation-unit
2007-10-09 17:35:09 -04:00
[ ] [
[
{ combination-1 { object generic-1 } } forget-all
] with-compilation-unit
] unit-test
2007-10-09 17:35:09 -04:00
GENERIC: some-generic
USE: arrays
M: array some-generic ;
USE: bit-arrays
M: bit-array some-generic ;
USE: byte-arrays
M: byte-array some-generic ;
TUPLE: some-class ;
M: some-class some-generic ;
TUPLE: another-class some-generic ;
[ ] [
[
{
some-generic
some-class
{ another-class some-generic }
} forget-all
] with-compilation-unit
2007-10-09 17:35:09 -04:00
] unit-test