[squeak-dev] The Inbox: KernelTests-cbc.277.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Sep 14 05:01:03 UTC 2014


A new version of KernelTests was added to project The Inbox:
http://source.squeak.org/inbox/KernelTests-cbc.277.mcz

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

Name: KernelTests-cbc.277
Author: cbc
Time: 13 September 2014, 9:58:54.543 pm
UUID: 035509c9-a60f-b44f-b55b-a17428783aa9
Ancestors: KernelTests-dtl.276

Added DateAndTimeArithmeticTest - to test adding things to DateAndTime instances.  This includes things like: DateAndTime now + 3 days.
Test convering adding various durations (like above) as well as addint strings, numbers, Timespans, Times, and DatAndTimes.
Also tests subtracting the same.

=============== Diff against KernelTests-dtl.276 ===============

Item was added:
+ TestCase subclass: #DateAndTimeArithmeticTest
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'KernelTests-Chronology'!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddDateAndTime1 (in category 'testing') -----
+ testAddDateAndTime1
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + (DateAndTime year: 2014 month: 3 day: 31)) = (DateAndTime year: 2014 month: 1 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddDateAndTime2 (in category 'testing') -----
+ testAddDateAndTime2
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) + (DateAndTime year: 2014 month: 1 day: 31)) = (DateAndTime year: 2014 month: 3 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddDays (in category 'testing') -----
+ testAddDays
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 days) = (DateAndTime year: 2014 month: 2 day: 2)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddHours (in category 'testing') -----
+ testAddHours
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 hours) = (DateAndTime year: 2014 month: 1 day: 31 hour: 2 minute: 0)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddIntegers (in category 'testing') -----
+ testAddIntegers
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2) = (DateAndTime year: 2014 month: 1 day: 31 hour: 0 minute: 0 second: 0 nanoSecond: 000000002 offset: DateAndTime localOffset)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddMinutes (in category 'testing') -----
+ testAddMinutes
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 minutes) = (DateAndTime year: 2014 month: 1 day: 31 hour: 0 minute: 2)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddMonths1 (in category 'testing') -----
+ testAddMonths1
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 1 month) = (DateAndTime year: 2014 month: 2 day: 28)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddMonths2 (in category 'testing') -----
+ testAddMonths2
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 months) = (DateAndTime year: 2014 month: 3 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddMonths4 (in category 'testing') -----
+ testAddMonths4
+ 	self assert: ((DateAndTime year: 2004 month: 1 day: 31) + 1 month) = (DateAndTime year: 2004 month: 2 day: 29)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddNanoSeconds (in category 'testing') -----
+ testAddNanoSeconds
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 nanoSeconds) = (DateAndTime year: 2014 month: 1 day: 31 hour: 0 minute: 0 second: 0 nanoSecond: 000000002 offset: DateAndTime localOffset)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddSeconds (in category 'testing') -----
+ testAddSeconds
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 seconds) = (DateAndTime year: 2014 month: 1 day: 31 hour: 0 minute: 0 second: 2)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddStrings (in category 'testing') -----
+ testAddStrings
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + '02:00:00:00') = (DateAndTime year: 2014 month: 2 day: 2)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddTime (in category 'testing') -----
+ testAddTime
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + ('02:00:00' asTime)) = (DateAndTime year: 2014 month: 1 day: 31 hour: 2 minute: 0)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddTimespan (in category 'testing') -----
+ testAddTimespan
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) 
+ 		+ ((DateAndTime year: 2014 month: 1 day: 1) to: (DateAndTime year: 2014 month: 1 day: 3))) 
+ 		= (DateAndTime year: 2014 month: 2 day: 2 hour: 0 minute: 0)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddWeeks (in category 'testing') -----
+ testAddWeeks
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) + 2 weeks) = (DateAndTime year: 2014 month: 2 day: 14)
+ 
+ !

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddYears1 (in category 'testing') -----
+ testAddYears1
+ 	self assert: ((DateAndTime year: 2006 month: 1 day: 31) + 2 years) = (DateAndTime year: 2008 month: 1 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddYears2 (in category 'testing') -----
+ testAddYears2
+ 	self assert: ((DateAndTime year: 2007 month: 1 day: 31) + 2 years) = (DateAndTime year: 2009 month: 1 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddYears3 (in category 'testing') -----
+ testAddYears3
+ 	self assert: ((DateAndTime year: 2004 month: 2 day: 29) + 1 year) = (DateAndTime year: 2005 month: 2 day: 28)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractDateAndTime1 (in category 'testing') -----
+ testSubtractDateAndTime1
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - (DateAndTime year: 2014 month: 1 day: 31)) = 59 days!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractDateAndTime2 (in category 'testing') -----
+ testSubtractDateAndTime2
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) - (DateAndTime year: 2014 month: 3 day: 31)) = 59 days negated!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractDays (in category 'testing') -----
+ testSubtractDays
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 days) = (DateAndTime year: 2014 month: 3 day: 29)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractHours (in category 'testing') -----
+ testSubtractHours
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 hours) = (DateAndTime year: 2014 month: 3 day: 30 hour: 22 minute: 0)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractIntegers (in category 'testing') -----
+ testSubtractIntegers
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2) = (DateAndTime year: 2014 month: 3 day: 30 hour: 23 minute: 59 second: 59 nanoSecond: 999999998 offset: DateAndTime localOffset)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractMinutes (in category 'testing') -----
+ testSubtractMinutes
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 minutes) = (DateAndTime year: 2014 month: 3 day: 30 hour: 23 minute: 58)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractMonths1 (in category 'testing') -----
+ testSubtractMonths1
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 1 month) = (DateAndTime year: 2014 month: 2 day: 28)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractMonths2 (in category 'testing') -----
+ testSubtractMonths2
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 months) = (DateAndTime year: 2014 month: 1 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractMonths3 (in category 'testing') -----
+ testSubtractMonths3
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 14) - 1 month) = (DateAndTime year: 2014 month: 2 day: 14)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractMonths4 (in category 'testing') -----
+ testSubtractMonths4
+ 	self assert: ((DateAndTime year: 2004 month: 3 day: 31) - 1 month) = (DateAndTime year: 2004 month: 2 day: 29)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractNanoSeconds (in category 'testing') -----
+ testSubtractNanoSeconds
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 nanoSeconds) = (DateAndTime year: 2014 month: 3 day: 30 hour: 23 minute: 59 second: 59 nanoSecond: 999999998 offset: DateAndTime localOffset)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractSeconds (in category 'testing') -----
+ testSubtractSeconds
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 seconds) = (DateAndTime year: 2014 month: 3 day: 30 hour: 23 minute: 59 second: 58)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractStrings (in category 'testing') -----
+ testSubtractStrings
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 31) - '02:00:00:00') = (DateAndTime year: 2014 month: 3 day: 29)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractTime (in category 'testing') -----
+ testSubtractTime
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - ('02:00:00' asTime)) = (DateAndTime year: 2014 month: 3 day: 30 hour: 22 minute: 0)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractTimespan (in category 'testing') -----
+ testSubtractTimespan
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) 
+ 		- ((DateAndTime year: 2014 month: 1 day: 1) to: (DateAndTime year: 2014 month: 1 day: 3))) 
+ 		= (DateAndTime year: 2014 month: 3 day: 29)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractWeeks (in category 'testing') -----
+ testSubtractWeeks
+ 	self assert: ((DateAndTime year: 2014 month: 3 day: 31) - 2 weeks) = (DateAndTime year: 2014 month: 3 day: 17)
+ 
+ !

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractYears1 (in category 'testing') -----
+ testSubtractYears1
+ 	self assert: ((DateAndTime year: 2008 month: 1 day: 31) - 2 years) = (DateAndTime year: 2006 month: 1 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractYears2 (in category 'testing') -----
+ testSubtractYears2
+ 	self assert: ((DateAndTime year: 2009 month: 1 day: 31) - 2 years) = (DateAndTime year: 2007 month: 1 day: 31)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractYears3 (in category 'testing') -----
+ testSubtractYears3
+ 	self assert: ((DateAndTime year: 2005 month: 2 day: 28) - 1 year) = (DateAndTime year: 2004 month: 2 day: 28)!



More information about the Squeak-dev mailing list