OldParserTest.st
author Claus Gittinger <cg@exept.de>
Wed, 15 May 2002 12:48:20 +0200
changeset 1269 3eb8c131aefe
child 1270 f8848593161c
permissions -rw-r--r--
initial checkin

"{ Package: 'stx:libcomp' }"

TestCase subclass:#OldParserTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'System-Compiler'
!

!OldParserTest class methodsFor:'documentation'!

documentation
"
    documentation to be added.

    [author:]
        Claus Gittinger (cg@alan)

    [see also:]

    [instance variables:]

    [class variables:]
"
!

history
    "Created: / 15.5.2002 / 14:15:10 / cg"
! !

!OldParserTest methodsFor:'initialize / release'!

setUp
    "common setup - invoked before testing"

    super setUp
!

tearDown
    "common cleanup - invoked after testing"

    super tearDown
! !

!OldParserTest methodsFor:'tests'!

test1
    "Just a demonstration testCase.
     Double click on the TestCase class or open a TestRunner to see me checking...
     - please add more methods like this..."

    |o|

    o := Array new:2.
    self assert: ( o size == 2 ).
    self should: [ o at:0 ] raise:Error.
    self shouldnt: [ o at:1 ] raise:Error.

    "
     self run:#test1
    "
!

testSqueakExtensions
     |rslt|

     Compiler allowSqueakExtensions:true.

     rslt := Compiler 
        evaluate:' {  }'.
     self assert:( rslt = #() ).

     rslt := Compiler 
        evaluate:' { 1 }'.
     self assert:( rslt = #(1) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 }'.
     self assert:( rslt = #( 1 2 ) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 }'.
     self assert:( rslt = #( 1 2 3 ) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 }'.
     self assert:( rslt = #( 1 2 3 4) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 . 5 }'.
     self assert:( rslt = #( 1 2 3 4 5) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 . 5 . 6 }'.
     self assert:( rslt = #( 1 2 3 4 5 6) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 . 5 . 6 . 7 }'.
     self assert:( rslt = #( 1 2 3 4 5 6 7) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 }'.
     self assert:( rslt = #( 1 2 3 4 5 6 7 8) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9}'.
     self assert:( rslt = #( 1 2 3 4 5 6 7 8 9) ).

     rslt := Compiler 
        evaluate:' { 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 10 }'.
     self assert:( rslt = #( 1 2 3 4 5 6 7 8 9 10) ).

     rslt := Compiler 
        evaluate:' { 1 factorial. 
                     2 factorial. 
                     3 factorial. 
                     4 factorial. 
                     5 factorial. 
                     6 factorial. 
                     7 factorial. 
                     8 factorial. 
                     9 factorial. 
                    10 factorial }'.
     self assert:( rslt = (#( 1 2 3 4 5 6 7 8 9 10) collect:[:n | n factorial]) ).

     Compiler allowSqueakExtensions:false.

    "
     self run:#testSqueakExtensions
     self new testSqueakExtensions
    "
! !

!OldParserTest class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libcomp/OldParserTest.st,v 1.1 2002-05-15 10:48:20 cg Exp $'
! !