factor/core/classes/singleton/singleton-tests.factor

20 lines
645 B
Factor
Raw Normal View History

USING: classes.singleton io.streams.string kernel see tools.test ;
2008-04-01 17:51:48 -04:00
IN: classes.singleton.tests
2008-03-07 21:06:23 -05:00
{ } [ SINGLETON: bzzt ] unit-test
{ t } [ bzzt bzzt? ] unit-test
{ t } [ bzzt bzzt eq? ] unit-test
2008-04-02 14:13:56 -04:00
GENERIC: zammo ( obj -- str )
{ } [ M: bzzt zammo drop "yes!" ; ] unit-test
{ "yes!" } [ bzzt zammo ] unit-test
{ } [ SINGLETON: omg ] unit-test
{ t } [ omg singleton-class? ] unit-test
{ "IN: classes.singleton.tests\nSINGLETON: omg\n" } [ [ omg see ] with-string-writer ] unit-test
2008-05-10 19:09:10 -04:00
SINGLETON: word-and-singleton
2009-03-23 01:34:02 -04:00
: word-and-singleton ( -- x ) 3 ;
2008-05-10 19:09:10 -04:00
{ t } [ \ word-and-singleton word-and-singleton? ] unit-test
{ 3 } [ word-and-singleton ] unit-test