OldParserTest.st
changeset 1270 f8848593161c
parent 1269 3eb8c131aefe
equal deleted inserted replaced
1269:3eb8c131aefe 1270:f8848593161c
    42     super tearDown
    42     super tearDown
    43 ! !
    43 ! !
    44 
    44 
    45 !OldParserTest methodsFor:'tests'!
    45 !OldParserTest methodsFor:'tests'!
    46 
    46 
    47 test1
    47 testSqueakExtensions1
    48     "Just a demonstration testCase.
       
    49      Double click on the TestCase class or open a TestRunner to see me checking...
       
    50      - please add more methods like this..."
       
    51 
       
    52     |o|
       
    53 
       
    54     o := Array new:2.
       
    55     self assert: ( o size == 2 ).
       
    56     self should: [ o at:0 ] raise:Error.
       
    57     self shouldnt: [ o at:1 ] raise:Error.
       
    58 
       
    59     "
       
    60      self run:#test1
       
    61     "
       
    62 !
       
    63 
       
    64 testSqueakExtensions
       
    65      |rslt|
    48      |rslt|
    66 
    49 
    67      Compiler allowSqueakExtensions:true.
    50      Compiler allowSqueakExtensions:true.
    68 
    51 
    69      rslt := Compiler 
    52      rslt := Compiler 
   127 
   110 
   128     "
   111     "
   129      self run:#testSqueakExtensions
   112      self run:#testSqueakExtensions
   130      self new testSqueakExtensions
   113      self new testSqueakExtensions
   131     "
   114     "
       
   115 !
       
   116 
       
   117 testSqueakExtensions2
       
   118     |rslt|
       
   119 
       
   120     Compiler allowSqueakExtensions:true.
       
   121     Class withoutUpdatingChangesDo:[
       
   122         self class compile:'
       
   123 
       
   124 __test
       
   125     ^ {  
       
   126         { 1 factorial }.
       
   127         { 2 factorial }.
       
   128         { 3 factorial }.
       
   129         { 4 factorial }.
       
   130         { 5 factorial }.
       
   131         { 6 factorial }.
       
   132         { 7 factorial }.
       
   133         { 8 factorial }.
       
   134         { 9 factorial }.
       
   135         { 10 factorial }.
       
   136       }
       
   137 '.
       
   138     ].
       
   139 
       
   140     rslt := self perform:#__test.
       
   141     self assert:( rslt = ( (1 to:10) collect:[:n | (Array with:n factorial)] ) asArray).
       
   142 
       
   143     Class withoutUpdatingChangesDo:[
       
   144         self class removeSelector:#__test
       
   145     ].
       
   146     Compiler allowSqueakExtensions:false.
       
   147 
       
   148     "
       
   149      self run:#testSqueakExtensions2
       
   150      self new testSqueakExtensions2
       
   151     "
   132 ! !
   152 ! !
   133 
   153 
   134 !OldParserTest class methodsFor:'documentation'!
   154 !OldParserTest class methodsFor:'documentation'!
   135 
   155 
   136 version
   156 version
   137     ^ '$Header: /cvs/stx/stx/libcomp/OldParserTest.st,v 1.1 2002-05-15 10:48:20 cg Exp $'
   157     ^ '$Header: /cvs/stx/stx/libcomp/OldParserTest.st,v 1.2 2002-05-15 10:52:32 cg Exp $'
   138 ! !
   158 ! !