libs-steptalk/Testing/Smalltalk/test.st
Stefan Urbanek 2b961fe6fe Code cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@13882 72102866-910b-0410-8b05-ffd578937521
2002-06-14 08:42:00 +00:00

48 lines
810 B
Smalltalk

[| :array
main
self testBlock.
self testExceptions.
^self
!
testBlock
| count array |
Transcript showLine:'> Block test'.
array := #( ).
1 to: 5 do: [ :i | array addObject:i ].
count := 0.
array do: [ :element | count := count + 1. ].
Transcript showLine:'count ', (count stringValue).
array do: [ :i |
array do: [ :j |
Transcript show:((i stringValue), (j stringValue),' ').
].
Transcript show:'\n'.
].
^self
!
testExceptions
Transcript showLine:'> Exception handler test'.
[ NSException raise:'Some exception' format:' '. ]
handler:
[ :localException |
Transcript showLine:(' Exception: ', localException name).
].
^self
]