[squeak-dev] The Inbox: KernelTests-it.69.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Inbox: KernelTests-it.69.mcz

commits-2
A new version of KernelTests was added to project The Inbox:
http://source.squeak.org/inbox/KernelTests-it.69.mcz

==================== Summary ====================

Name: KernelTests-it.69
Author: it
Time: 14 July 2009, 8:07:54 am
UUID: aa27579e-d406-3745-a642-69eefa4b0af1
Ancestors: KernelTests-it.68

Reformatted code in Week>>startDay.

Added tests for Week class methods indexOfDay:, nameOfDay: and dayNames.

=============== Diff against KernelTests-dtl.465 ===============

Item was added:
+ ----- Method: TrueTest>>testAnd (in category 'testing') -----
+ testAnd
+
+ self assert: (true and: ['alternativeBlock']) = 'alternativeBlock'.!

Item was added:
+ ----- Method: TrueTest>>testIfTrue (in category 'testing') -----
+ testIfTrue
+
+ self assert: (true ifTrue: ['alternativeBlock']) = 'alternativeBlock'. !

Item was added:
+ ----- Method: WeekTest>>testIndexOfDay (in category 'Tests') -----
+ testIndexOfDay
+ | days |
+ days := #(#Sunday #Monday #Tuesday #Wednesday #Thursday #Friday #Saturday).
+
+ days withIndexDo: [:item :index | self assert: (Week indexOfDay: item) = index].
+
+ "This should probably raise an error rather than returning 0."
+ self assert: (Week indexOfDay: 0) = 0.
+ self assert: (Week indexOfDay: 1) = 0.
+ self assert: (Week indexOfDay: 7) = 0.
+ self assert: (Week indexOfDay: 8) = 0.
+ self assert: (Week indexOfDay: #Sunnyday) = 0.!

Item was added:
+ ----- Method: TrueTest>>testOR (in category 'testing') -----
+ testOR
+
+ self assert: (true | true) = true.
+ self assert: (true | false) = true.!

Item was added:
+ ----- Method: MonthTest>>testNameOfMonth (in category 'Tests') -----
+ testNameOfMonth
+
+ | m |
+ m := #(#January #February #March #April #May #June #July #August #September #October #November #December).
+
+ m withIndexDo: [:item :index | self assert: (Month nameOfMonth: index) = item].
+
+ self should: [Month nameOfMonth: 0] raise: TestResult error.
+ self should: [Month nameOfMonth: 13] raise: TestResult error.
+ self should: [Month nameOfMonth: #January] raise: TestResult error.!

Item was added:
+ ----- Method: WeekTest>>testNameOfDay (in category 'Tests') -----
+ testNameOfDay
+ | days |
+ days := #(#Sunday #Monday #Tuesday #Wednesday #Thursday #Friday #Saturday).
+
+ days withIndexDo: [:item :index | self assert: (Week nameOfDay: index) = item].
+
+ self should: [Week nameOfDay: 0] raise: TestResult error.
+ self should: [Week nameOfDay: 8] raise: TestResult error.
+ self should: [Week nameOfDay: #Sunday] raise: TestResult error.!

Item was changed:
  ----- Method: TrueTest>>testNot (in category 'testing') -----
  testNot
 
+ self assert: (true not = false).!
- self assert: (false not = true).!

Item was added:
+ ----- Method: TrueTest>>testIfTrueIfFalse (in category 'testing') -----
+ testIfTrueIfFalse
+
+ self assert: (true ifTrue: ['trueAlternativeBlock']
+                       ifFalse: ['falseAlternativeBlock']) = 'trueAlternativeBlock'. !

Item was added:
+ ----- Method: TrueTest>>testIfFalse (in category 'testing') -----
+ testIfFalse
+
+ self assert: (true ifFalse: ['alternativeBlock']) = nil. !

Item was added:
+ ----- Method: MonthTest>>testIndexOfMonth (in category 'Tests') -----
+ testIndexOfMonth
+
+ | m |
+ m := #(#January #February #March #April #May #June #July #August #September #October #November #December).
+
+ m withIndexDo: [:item :index | self assert: (Month indexOfMonth: item) = index].
+
+ self should: [Month indexOfMonth: 1] raise: TestResult error.
+ self should: [Month indexOfMonth: #1] raise: TestResult error.
+ self should: [Month indexOfMonth: #Marsh] raise: TestResult error. "notice the misspell!!"
+ self should: [Month indexOfMonth: #UnexistingMonth] raise: TestResult error.!

Item was added:
+ ----- Method: ClassBuilderFormatTests>>testChangeToVariableSubclass (in category 'testing') -----
+ testChangeToVariableSubclass
+ "Ensure that the invariants for superclass/subclass format are preserved"
+ baseClass := Object subclass: self baseClassName
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Kernel-Tests-ClassBuilder'.
+ [
+ self shouldnt:[baseClass := Object variableSubclass: self baseClassName
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Kernel-Tests-ClassBuilder'] raise: Error.
+
+ ] ensure:[self cleanup].!

Item was added:
+ ----- Method: FalseTest>>testAsBit (in category 'tests') -----
+ testAsBit
+
+ self assert: (false asBit = 0).!

Item was changed:
  ----- Method: TrueTest>>testInMemory (in category 'testing') -----
  testInMemory
 
+ self assert: (true isInMemory = true).!
- self assert: (false isInMemory = true).!

Item was added:
+ ----- Method: WeekTest>>testDayNames (in category 'Tests') -----
+ testDayNames
+ self assert: (Week dayNames) = #(#Sunday #Monday #Tuesday #Wednesday #Thursday #Friday #Saturday).!

Item was added:
+ ----- Method: TrueTest>>testIfFalseIfTrue (in category 'testing') -----
+ testIfFalseIfTrue
+
+ self assert: (true ifFalse: ['falseAlternativeBlock']
+                       ifTrue: ['trueAlternativeBlock']) = 'trueAlternativeBlock'. !

Item was added:
+ ----- Method: FalseTest>>testInMemory (in category 'tests') -----
+ testInMemory
+
+ self assert: (false isInMemory = true).!

Item was added:
+ ----- Method: TrueTest>>testOr (in category 'testing') -----
+ testOr
+
+ self assert: (true or: ['alternativeBlock']) = true.!

Item was added:
+ ----- Method: TrueTest>>testAsBit (in category 'testing') -----
+ testAsBit
+
+ self assert: (true asBit = 1).!