]> gitweb.factorcode.org Git - factor.git/blob - core/classes/singleton/singleton-tests.factor
factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:.
[factor.git] / core / classes / singleton / singleton-tests.factor
1 USING: kernel classes.singleton tools.test prettyprint io.streams.string see ;
2 IN: classes.singleton.tests
3
4 { } [ SINGLETON: bzzt ] unit-test
5 { t } [ bzzt bzzt? ] unit-test
6 { t } [ bzzt bzzt eq? ] unit-test
7 GENERIC: zammo ( obj -- str )
8 { } [ M: bzzt zammo drop "yes!" ; ] unit-test
9 { "yes!" } [ bzzt zammo ] unit-test
10 { } [ SINGLETON: omg ] unit-test
11 { t } [ omg singleton-class? ] unit-test
12 { "IN: classes.singleton.tests\nSINGLETON: omg\n" } [ [ omg see ] with-string-writer ] unit-test
13
14 SINGLETON: word-and-singleton
15
16 : word-and-singleton ( -- x ) 3 ;
17
18 { t } [ \ word-and-singleton word-and-singleton? ] unit-test
19 { 3 } [ word-and-singleton ] unit-test