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

52 lines
1.1 KiB
Factor
Raw Normal View History

USING: tools.test tools.annotations tools.time math parser eval
2009-03-06 18:35:33 -05:00
io.streams.string kernel strings ;
2008-03-01 17:00:45 -05:00
IN: tools.annotations.tests
2007-09-20 18:09:08 -04:00
2009-03-23 01:34:02 -04:00
: foo ( -- ) ;
2007-09-20 18:09:08 -04:00
\ 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
2009-04-17 16:49:21 -04: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
2009-04-17 16:49:21 -04:00
[ ] [ "IN: tools.annotations.tests GENERIC: another-generic ( a -- b )" eval( -- ) ] unit-test
2008-08-23 21:24:54 -04:00
[ ] [ \ another-generic reset ] unit-test
[ "" ] [ [ 3 another-generic drop ] with-string-writer ] unit-test
! reset should do the right thing for generic words
[ ] [ \ another-generic watch ] unit-test
GENERIC: blah-generic ( a -- b )
M: string blah-generic ;
2009-04-06 06:22:28 -04:00
[ ] [ M\ string blah-generic watch ] unit-test
2009-03-07 16:58:14 -05:00
[ "hi" ] [ "hi" blah-generic ] unit-test