factor/basis/tools/annotations/annotations-tests.factor

41 lines
851 B
Factor
Raw Normal View History

2008-08-23 21:24:54 -04:00
USING: tools.test tools.annotations math parser eval
io.streams.string kernel ;
2008-03-01 17:00:45 -05:00
IN: tools.annotations.tests
2007-09-20 18:09:08 -04:00
: foo ;
\ foo watch
[ ] [ foo ] unit-test
2008-02-16 16:54:53 -05:00
! erg's bug
2008-02-17 19:38:29 -05:00
GENERIC: some-generic ( a -- b )
2008-02-16 16:54:53 -05:00
M: integer some-generic 1+ ;
[ 4 ] [ 3 some-generic ] unit-test
[ ] [ \ some-generic watch ] unit-test
[ 4 ] [ 3 some-generic ] unit-test
2008-03-01 17:00:45 -05:00
[ ] [ "IN: tools.annotations.tests USE: math M: integer some-generic 1- ;" eval ] unit-test
2008-02-16 16:54:53 -05:00
[ 2 ] [ 3 some-generic ] unit-test
[ ] [ \ some-generic reset ] unit-test
[ 2 ] [ 3 some-generic ] unit-test
2008-08-23 21:24:54 -04:00
! slava's bug
GENERIC: another-generic ( a -- b )
M: object another-generic ;
\ another-generic watch
[ ] [ "IN: tools.annotations.tests GENERIC: another-generic ( a -- b )" eval ] unit-test
[ ] [ \ another-generic reset ] unit-test
[ "" ] [ [ 3 another-generic drop ] with-string-writer ] unit-test