123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- TestCase subclass: #StringTest
- instanceVariableNames: ''
- category: 'Kernel-Tests'!
- !StringTest methodsFor: 'tests'!
- testJoin
- self assert: 'hello,world' equals: (',' join: #('hello' 'world'))
- !
- testStreamContents
- self
- assert: 'hello world'
- equals: (String streamContents: [:aStream| aStream
- nextPutAll: 'hello'; space;
- nextPutAll: 'world'])
- !
- testIncludesSubString
- self assert: ('jtalk' includesSubString: 'alk').
- self deny: ('jtalk' includesSubString: 'zork').
- ! !
- TestCase subclass: #DictionaryTest
- instanceVariableNames: ''
- category: 'Kernel-Tests'!
- !DictionaryTest methodsFor: 'tests'!
- testPrintString
- self
- assert: 'a Dictionary(''firstname'' -> ''James'' , ''lastname'' -> ''Bond'')'
- equals: (Dictionary new
- at:'firstname' put: 'James';
- at:'lastname' put: 'Bond';
- printString)
- ! !
- TestCase subclass: #BooleanTest
- instanceVariableNames: ''
- category: 'Kernel-Tests'!
- !BooleanTest methodsFor: 'not yet classified'!
- testLogic
- "Trivial logic table"
- self assert: (true & true); deny: (true & false); deny: (false & true); deny: (false & false).
- self assert: (true | true); assert: (true | false); assert: (false | true); deny: (false | false).
- "Checking that expressions work fine too"
- self assert: (true & (1 > 0)); deny: ((1 > 0) & false); deny: ((1 > 0) & (1 > 2)).
- self assert: (false | (1 > 0)); assert: ((1 > 0) | false); assert: ((1 > 0) | (1 > 2))
- ! !
|