Andreas Raab uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ar.159.mcz ==================== Summary ==================== Name: KernelTests-ar.159 Author: ar Time: 2 September 2010, 7:57:14.615 pm UUID: 18eb5c84-0f3b-424e-a163-014c539e0dc0 Ancestors: KernelTests-dtl.158, KernelTests-spd.157 Merging KernelTests-spd.157: - moved printString tests from testReadFrom to testPrintString - testReadFrom now tests [drum roll]... readFrom! - added testFromString All tests reflect new behavior from Kernel-spd.476 which fixed issue 7553 =============== Diff against KernelTests-dtl.158 =============== Item was changed: ----- Method: DateAndTimeTest>>testReadFrom (in category 'Tests') ----- testReadFrom + self assert: ((DateAndTime readFrom: '-1199-01-05T20:33:14.321-05:00' readStream) printString = '-1199-01-05T20:33:14.321-05:00'). + + + ! - self assert: ('-1199-01-05T20:33:14.321-05:00' asDateAndTime printString = '-1199-01-05T20:33:14.321-05:00'). - self assert: ('2002-05-16T17:20:45.1+01:01' asDateAndTime printString = '2002-05-16T17:20:45.1+01:01'). - self assert: (' 2002-05-16T17:20:45.02+01:01' asDateAndTime printString = '2002-05-16T17:20:45.02+01:01'). - self assert: ('2002-05-16T17:20:45.000000009+01:01' asDateAndTime printString = '2002-05-16T17:20:45.000000009+01:01'). - self assert: (' 2002-05-16T17:20' asDateAndTime printString = '2002-05-16T17:20:00+00:00'). - self assert: ('2002-05-16T17:20:45' asDateAndTime printString = '2002-05-16T17:20:45+00:00' ). - self assert: (' 2002-05-16T17:20:45+01:57' asDateAndTime printString = '2002-05-16T17:20:45+01:57'). - self assert: (' 2002-05-16T17:20:45-02:34' asDateAndTime = '2002-05-16T17:20:45-02:34' asDateAndTime). - self assert: ('2002-05-16T17:20:45+00:00' asDateAndTime = '2002-05-16T17:20:45+00:00' asDateAndTime). - self assert: ('1997-04-26T01:02:03+01:02:3' asDateAndTime = '1997-04-26T01:02:03+01:02:3' asDateAndTime)! Item was changed: ----- Method: DateAndTimeTest>>testPrintString (in category 'Tests') ----- testPrintString "(self new setTestSelector: #testPrintString) debug" + | dt dtNoOffset | - | dt | dt :=DateAndTime year: 2004 month: 11 day: 2 hour: 14 minute: 3 second: 5 nanoSecond: 12345 offset: (Duration seconds: (5 * 3600)). + self assert: dt printString = '2004-11-02T14:03:05.000012345+05:00'. + + self assert: ('2002-05-16T17:20:45.1+01:01' asDateAndTime printString = '2002-05-16T17:20:45.1+01:01'). + self assert: (' 2002-05-16T17:20:45.02+01:01' asDateAndTime printString = '2002-05-16T17:20:45.02+01:01'). + self assert: ('2002-05-16T17:20:45.000000009+01:01' asDateAndTime printString = '2002-05-16T17:20:45.000000009+01:01'). + self assert: ('2002-05-16T17:20:45+00:00' asDateAndTime printString = '2002-05-16T17:20:45+00:00' ). + self assert: (' 2002-05-16T17:20:45+01:57' asDateAndTime printString = '2002-05-16T17:20:45+01:57'). + self assert: (' 2002-05-16T17:20:45-02:34' asDateAndTime = '2002-05-16T17:20:45-02:34'). + self assert: ('2002-05-16T17:20:45+00:00' asDateAndTime = '2002-05-16T17:20:45+00:00'). + self assert: ('1997-04-26T01:02:03+01:02:3' asDateAndTime = '1997-04-26T01:02:03+01:02:3'). - self assert: dt printString = '2004-11-02T14:03:05.000012345+05:00' + "When no offset is provided, the local one is used" + dtNoOffset := '2002-05-16T17:20' asDateAndTime. + self assert: (('2002-05-16T17:20:00*' match: dtNoOffset printString) and: [dtNoOffset offset = DateAndTime localOffset]). ! Item was added: + ----- Method: DateAndTimeTest>>testFromString (in category 'Tests') ----- + testFromString + + | fromString fromStringNoOffset | + fromString := DateAndTime fromString: '-1199-01-05T20:33:14.321-05:00'. + self assert: (fromString printString = '-1199-01-05T20:33:14.321-05:00'). + + "if no offset is provided, the local offset should be used" + fromStringNoOffset := DateAndTime fromString: '-1199-01-05T20:33:14.321'. + self assert: (fromStringNoOffset offset = DateAndTime localOffset).! |
Free forum by Nabble | Edit this page |