[squeak-dev] The Trunk: KernelTests-dtl.235.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Nov 4 18:09:22 UTC 2012


David T. Lewis uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-dtl.235.mcz

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

Name: KernelTests-dtl.235
Author: dtl
Time: 4 November 2012, 1:08:04.014 pm
UUID: de45cee9-3416-4fd8-a216-b5cafe70ee57
Ancestors: KernelTests-ul.234

As of Kernel-cmm.671 Timespans created in the context of an offset will start in that offset, and when no context is available the defaultOffset for a Timespan will be zero. This affects a TimeStamp created from a string representation of itself, which will now have zero offset (UTC). Update TimeStampTest to reflect to this behavior.

=============== Diff against KernelTests-ul.234 ===============

Item was changed:
  ----- Method: TimeStampTest>>testFromSeconds (in category 'Tests') -----
  testFromSeconds
+ 	"A time stamp from seconds is created in the local time zone, so offset may
+ 	be non-zero. The test timestamp has offset zero (implying UTC). Comparison
+ 	to the test timestamp should succeed if and only if both time stamps are
+ 	created relative to the same time zone (UTC)."
  
+ 	| local utc |
+ 	local := self timestampClass fromSeconds: 3124958100.
+ 	local offset = Duration zero
+ 		ifTrue: [self assert: local = timestamp.]
+ 		ifFalse: [self deny: local = timestamp.].
+ 	utc := local offset: Duration zero.
+ 	self assert: utc = timestamp.!
- 	self
- 		assert: (self timestampClass fromSeconds: 3124958100) = timestamp.!

Item was changed:
  ----- Method: TimeStampTest>>testReadFromA1 (in category 'testing') -----
  testReadFromA1
+ 	"Conversion to and from a string (with implied UTC offset) is equal if
+ 	and only if the time stamp has zero offset."
  	|ts|
+ 	ts := TimeStamp current offset: Duration zero. "current as UTC"
+ 	self assert: (ts = (TimeStamp fromString: ts asString)).
+ 	ts := TimeStamp current offset: (Duration hours: 1).
+ 	self deny: (ts = (TimeStamp fromString: ts asString)).
+ !
- 	ts := TimeStamp current.
- 	self assert: (ts = (TimeStamp fromString: ts asString)).!



More information about the Squeak-dev mailing list