RegressionTests__CompilerTest.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Nov 1999 10:37:35 +0100
changeset 47 3258d44978a0
child 48 022fba2b5917
permissions -rw-r--r--
initial checkin

Object subclass:#CompilerTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Tests - Compiler'
!


!CompilerTest methodsFor:'tests - constant folding'!

testFloat_pi
    ^ Float pi
!

testFloat_unity
    ^ Float unity
!

testFloat_zero
    ^ Float zero
!

testSmalltalk_if_else_isSmalltalkX
    Smalltalk isSmalltalkX ifTrue:[
        ^ 'yes'
    ] ifFalse:[
        ^ 'no'
    ]
!

testSmalltalk_if_else_isVisualWorks
    Smalltalk isVisualWorks ifTrue:[
        ^ 'yes'
    ] ifFalse:[
        ^ 'no'
    ]
!

testSmalltalk_if_isSmalltalkX
    Smalltalk isSmalltalkX ifTrue:[
        ^ 'yes'
    ].
    ^ 'no'
!

testSmalltalk_if_isSqueak
    Smalltalk isSqueak ifTrue:[
        ^ 'yes'
    ].
    ^ 'no'
!

testSmalltalk_if_isVisualWorks
    Smalltalk isVisualWorks ifTrue:[
        ^ 'yes'
    ].
    ^ 'no'
!

testSmalltalk_isSmalltalkX
    ^ Smalltalk isSmalltalkX
!

testSmalltalk_isSqueak
    ^ Smalltalk isSqueak
!

testSmalltalk_isVisualAge
    ^ Smalltalk isVisualAge
!

testSmalltalk_isVisualWorks
    ^ Smalltalk isVisualWorks
!

testUnaryFolding
    self testFloat_pi ~= (Float perform:#pi) ifTrue:[self halt].
    self testFloat_unity ~= (Float perform:#unity) ifTrue:[self halt].
    self testFloat_zero ~= (Float perform:#zero) ifTrue:[self halt].

    self testSmalltalk_isSmalltalkX ~= (Smalltalk perform:#isSmalltalkX) ifTrue:[self halt].
    self testSmalltalk_isSqueak ~= (Smalltalk perform:#isSqueak) ifTrue:[self halt].
    self testSmalltalk_isVisualWorks ~= (Smalltalk perform:#isVisualWorks) ifTrue:[self halt].
    self testSmalltalk_isVisualAge ~= (Smalltalk perform:#isVisualAge) ifTrue:[self halt].

    "
     self basicNew testUnaryFolding
    "
! !

!CompilerTest class methodsFor:'documentation'!

version
    ^ '$Header$'
! !