[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

sunit[s8] Equality tests

TestCase 
   subclass: #TestEquality
   instanceVariableNames: ''
   category: 'sunit-s8'!

! TestEquality methodsFor: 'test'!
testEq1
   self assert: (1 + 1 / 2 = 1 = true)! !

! TestEquality methodsFor: 'test'!
testEq2
   self assert: (1 + 1 - 1 = 2 = false) ! !

! TestEquality methodsFor: 'test'!
testEq3
   self assert: (1 + 1 - 1 = #1 = false) ! !

! TestEquality methodsFor: 'test'!
testEq4
   self assert: (1 + 1 - 1 = $1 = false) ! !

! TestEquality methodsFor: 'test'!
testEq5
   self assert: (1 + 1 - 1 = true = false) ! !

! TestEquality methodsFor: 'test'!
testEq6
   self assert: (1 - 1 = nil = false) ! !

! TestEquality methodsFor: 'test'!
testEq7
   self assert: (1 - 1 = false = false) ! !

! TestEquality methodsFor: 'test'!
testEq8
   self assert: (1 - 1 = (1 - 2) = false) ! !

! TestEquality methodsFor: 'test'!
testEq9
   | x | 
   x := 5@3. 
   self assert: (x = x = true) ! !

! TestEquality methodsFor: 'test'!
testEq10
    self assert: ($a = #a = true) ! !

! TestEquality methodsFor: 'test'!
testEq11
    self assert: (12 = 12 = true) ! !

! TestEquality methodsFor: 'test'!
testEq12
    self assert: (nil = nil = true) ! !

! TestEquality methodsFor: 'test'!
testEq13
    self assert: (1 + 1 = (8 - 6) = true) ! !

! TestEquality methodsFor: 'test'!
testEq14
    self assert: (#(1 2 3) = #(3 2 1) reversed = true) ! !

! TestEquality methodsFor: 'test'!
testEq15
    self assert: (true = #true = false) ! !

! TestEquality methodsFor: 'test'!
testEq16
    self assert: (#12 = (10 + 2) = false) ! !

! TestEquality methodsFor: 'test'!
testEq17
    self assert: (#1 = (1 + 1 - 1) = false) ! !

! TestEquality methodsFor: 'test'!
testEq18
    self assert: (Array new = 0 = false) ! !

! TestEquality methodsFor: 'test'!
testEq19
    self assert: (0 = Array new = false) ! !

! TestEquality methodsFor: 'test'!
testEq20
    self assert: (0 = XXXX = false) ! !

! TestEquality methodsFor: 'test'!
testEq21
    self assert: (#(0) = 0 = false) ! !

! TestEquality methodsFor: 'test'!
testEq21
    self assert: (0 = #(0) = false) ! !

! TestEquality methodsFor: 'test'!
testEq22
    self assert: (#(#(0 1)) first first = 0 = true) ! !

! TestEquality methodsFor: 'test'!
testEq23
    self assert: (#(#(0 1)) last last = 1 = true) ! !

! TestEquality methodsFor: 'test'!
testEq24
    self assert: (#(98) = nil = false) ! !

! TestEquality methodsFor: 'test'!
testEq25
    self assert: (#(7 nil) last = nil = true) ! !

! TestEquality methodsFor: 'test'!
testEq26
    self assert: (nil = #(98) = false) ! !

! TestEquality methodsFor: 'test'!
testEq27
    self assert: (nil = #(98 nil) last = true) ! !

! TestEquality methodsFor: 'test'!
testEq28
    self assert: (#(98) last - 98 = 0 = true) ! !