mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-21 10:41:04 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@13882 72102866-910b-0410-8b05-ffd578937521
48 lines
810 B
Smalltalk
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
|
|
]
|