[Pkg] The Trunk: KernelTests-cmm.214.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 14 19:20:45 UTC 2012


Chris Muller uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-cmm.214.mcz

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

Name: KernelTests-cmm.214
Author: cmm
Time: 3 February 2012, 6:38:24.812 pm
UUID: 23ae3769-73c1-4ec4-b843-927b235b3a6f
Ancestors: KernelTests-ul.213

- Tests updated for globalized Timespans.

=============== Diff against KernelTests-ul.213 ===============

Item was changed:
  ----- Method: DateAndTimeLeapTest>>setUp (in category 'running') -----
  setUp
  	localTimeZoneToRestore := DateAndTime localTimeZone.
  	DateAndTime localTimeZone: TimeZone default.
  	aDateAndTime := (DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0 offset: 2 hours).
  	aTimeZone := TimeZone default.
+ 	aDuration := Duration days: 0 hours: 13 minutes: 33 seconds: 0 nanoSeconds: 0.
+ 	Timespan withAllSubclasses do: [ : each | each localize ]!
- 	aDuration := Duration days: 0 hours: 13 minutes: 33 seconds: 0 nanoSeconds: 0
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>tearDown (in category 'running') -----
  tearDown
+ 	DateAndTime localTimeZone: localTimeZoneToRestore.
+ 	Timespan withAllSubclassesDo: [ : each | each globalize ]!
-      DateAndTime localTimeZone: localTimeZoneToRestore.
-      "wish I could remove the time zones I added earlier, tut there is no method for that"
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>testAsDate (in category 'testing') -----
  testAsDate
+ 	self assert: (aDateAndTime offset: DateAndTime localTimeZone offset) asDate = 'February 29, 2004' asDate!
- 	self assert: aDateAndTime asDate =   'February 29, 2004' asDate.
- 
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>testAsMonth (in category 'testing') -----
  testAsMonth
+ 	self assert:
+ 		(aDateAndTime offset: Month defaultOffset) asMonth =
+ 			(Month
+ 				month: 'February'
+ 				year: 2004)!
- 	self assert: aDateAndTime asMonth = (Month month: 'February' year: 2004).
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>testAsSeconds (in category 'testing') -----
  testAsSeconds
+ 	self assert: aDuration asSeconds = 48780.
+ 	self assert: aDateAndTime asSeconds = 3255514380!
- 	self assert: aDuration asSeconds =  48780.
- 	self assert: aDateAndTime asSeconds =  3255507180
- 	
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>testAsWeek (in category 'testing') -----
  testAsWeek
+ 	self assert: (aDateAndTime offset: DateAndTime localTimeZone offset) asWeek = (Week starting: '02-29-2004' asDate)!
- 	self assert: aDateAndTime asWeek =    (Week starting: '02-29-2004' asDate).
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>testAsYear (in category 'testing') -----
  testAsYear
+ 	| year |
+ 	year := (aDateAndTime offset: DateAndTime localTimeZone offset) asYear.
+ 	self assert: year = (Year starting: '02-29-2004' asDate).
+ 	self deny: year = (Year starting: '01-01-2004' asDate)!
- 	self assert: aDateAndTime asYear =   (Year starting: '02-29-2004' asDate).  
- 	self deny: aDateAndTime asYear =   (Year starting: '01-01-2004' asDate)  
- !

Item was changed:
  ----- Method: DateAndTimeLeapTest>>testMidnight (in category 'testing') -----
  testMidnight
+ 	| midnight |
+ 	midnight := (aDateAndTime offset: DateAndTime localTimeZone offset) midnight.
+ 	self assert: midnight = '2004-02-29T00:00:00+00:00' asDateAndTime.
+ 	self deny: midnight = '2004-02-29T00:00:00+02:00' asDateAndTime!
- 	self assert: aDateAndTime midnight =  '2004-02-29T00:00:00+00:00' asDateAndTime.
- 	self deny: aDateAndTime midnight =  '2004-02-29T00:00:00+02:00' asDateAndTime
- !

Item was changed:
  ----- Method: DateTest>>testStarting (in category 'testing') -----
  testStarting
+ 	self assert: aDate = (Date starting: ((DateAndTime fromString: '2004-01-23T12:12') offset: Date defaultOffset))!
- 	self assert: aDate = (Date starting: (DateAndTime fromString: '2004-01-23T12:12')).  !

Item was changed:
  ----- Method: TimeStampTest>>testAccessing (in category 'Tests') -----
  testAccessing
  
  	| d t |
  	d := '1-10-2000' asDate.
  	t := '11:55:00 am' asTime.
  
  	self
+ 		assert: (timestamp offset: Date defaultOffset) date = d;
+ 		assert: (timestamp offset: Date defaultOffset) time = t.
- 		assert: timestamp date = d;
- 		assert: timestamp time = t.
  !

Item was changed:
  ----- Method: YearTest>>testCurrent (in category 'Tests') -----
  testCurrent
+ 	self assert:
+ 		Year current start =
+ 			((DateAndTime
+ 				year: DateAndTime now year
+ 				month: 1
+ 				day: 1) offset: Year defaultOffset)!
- 
- 	| yyyy |
- 
- 	yyyy := DateAndTime now year.
- 	
- 	self assert: Year current start = (DateAndTime year: yyyy month: 1 day: 1)!



More information about the Packages mailing list