home *** CD-ROM | disk | FTP | other *** search
/ Really Useful CD 1 / ReallyUsefulCD1.iso / extras / languages / smalltalk / _smalltalk / tests / blocks < prev    next >
Encoding:
Text File  |  1987-12-30  |  694 b   |  25 lines

  1. Class Main
  2. [
  3.      main
  4.           (2 < 3) ifTrue: ['correct-1' print].
  5.           ((2 < 3) ifTrue: ['correct-2']) print.
  6.           [:x | x print] value: 'correct-3' .
  7.           ((2 < 3) or: [3 < 4]) ifTrue: ['correct-4' print].
  8.           ((2 > 3) or: [3 < 4]) ifTrue: ['correct-5' print].
  9.           ((2 < 3) and: [3 < 4]) ifTrue: ['correct-6' print].
  10.           ((2 > 3) and: [3 < 4]) ifFalse: ['correct-7' print].
  11.           self test1 print
  12. |
  13.      test1
  14.           self test2: [^ 'correct-8'].
  15.           'should not print' print
  16. |
  17.      test2: aBlock
  18.           self test3: aBlock.
  19.           'should not print' print
  20. |
  21.      test3: bBlock
  22.           bBlock value.
  23.           'should not print' print
  24. ]
  25.