1 USING: kernel classes.singleton tools.test prettyprint io.streams.string ;
2 IN: classes.singleton.tests
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
14 SINGLETON: word-and-singleton
16 : word-and-singleton 3 ;
18 [ t ] [ \ word-and-singleton word-and-singleton? ] unit-test
19 [ 3 ] [ word-and-singleton ] unit-test