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

commits at source.squeak.org commits at source.squeak.org
Fri Mar 6 23:52:08 UTC 2015


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

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

Name: KernelTests-cbc.291
Author: cbc
Time: 6 March 2015, 3:52:01.005 pm
UUID: 54afce93-39e9-4c4a-92a4-ecbe32540c69
Ancestors: KernelTests-ul.290, KernelTests-cbc.278

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 adding strings, numbers, Timespans, Times, and DateAndTimes.
Also tests subtracting the same.

Added DurationArithmeticTest - tests expected outcomes of adding durations together, including the generic ones (resulting in GenericDuration instances).
Also, tested for certain tricky leapYear conditions when adding years.

=============== Diff against KernelTests-ul.290 ===============

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>>testAddMonthTimespan1 (in category 'testing') -----
+ testAddMonthTimespan1
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 1) + (Month month: 1 year: 2015) 
+ 		= (DateAndTime year: 2014 month: 2 day: 1)).
+ !

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddMonthTimespan2 (in category 'testing') -----
+ testAddMonthTimespan2
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 1) + (Month month: 2 year: 2004) 
+ 		= (DateAndTime year: 2014 month: 1 day: 30)).
+ !

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddMonthTimespan3 (in category 'testing') -----
+ testAddMonthTimespan3
+ 	self assert: ((DateAndTime year: 2014 month: 1 day: 1) + (Month month: 2 year: 2005) 
+ 		= (DateAndTime year: 2014 month: 1 day: 29)).
+ !

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)
+ 		!

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>>testAddYears4 (in category 'testing') -----
+ testAddYears4
+ 	self assert: ((DateAndTime year: 2003 month: 4 day: 1) + 2 years) = (DateAndTime year: 2005 month: 4 day: 1)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddYears5 (in category 'testing') -----
+ testAddYears5
+ 	self assert: ((DateAndTime year: 2003 month: 4 day: 1) + 1 years) = (DateAndTime year: 2004 month: 4 day: 1)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testAddYears6 (in category 'testing') -----
+ testAddYears6
+ 	self assert: ((DateAndTime year: 2011 month: 3 day: 1) + 1 years) = (DateAndTime year: 2012 month: 3 day: 1)
+ !

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: 1 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: 3 day: 1) to: (DateAndTime year: 2024 month: 1 day: 3)))   		= ('30:00:00:00' asDuration)!

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)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractYears4 (in category 'testing') -----
+ testSubtractYears4
+ 	self assert: ((DateAndTime year: 2005 month: 4 day: 1) - 2 years) = (DateAndTime year: 2003 month: 4 day: 1)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractYears5 (in category 'testing') -----
+ testSubtractYears5
+ 	self assert: ((DateAndTime year: 2004 month: 4 day: 1) - 1 years) = (DateAndTime year: 2003 month: 4 day: 1)!

Item was added:
+ ----- Method: DateAndTimeArithmeticTest>>testSubtractYears6 (in category 'testing') -----
+ testSubtractYears6
+ 	self assert: ((DateAndTime year: 2011 month: 3 day: 1) - 1 years) = (DateAndTime year: 2010 month: 3 day: 1)!

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

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddDayDurations (in category 'as yet unclassified') -----
+ testAddDayDurations
+ 	self assert: (1 day + 2 days = 3 days)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddDayHourDurations (in category 'as yet unclassified') -----
+ testAddDayHourDurations
+ 	self assert: (1 day + 2 hours = '1:02:00:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddDayMonthDurations (in category 'as yet unclassified') -----
+ testAddDayMonthDurations
+ 	self assert: (1 day + 2 months = (GenericDuration new + 1 day + 2 months))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddHourDayDurations (in category 'as yet unclassified') -----
+ testAddHourDayDurations
+ 	self assert: (1 hour + 2 days = '2:01:00:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddHourMinuteDurations (in category 'as yet unclassified') -----
+ testAddHourMinuteDurations
+ 	self assert: (1 hour + 2 minutes = '0:01:02:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddMinuteHourDurations (in category 'as yet unclassified') -----
+ testAddMinuteHourDurations
+ 	self assert: (1 minute + 2 hours = '0:02:01:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddMinuteSecondDurations (in category 'as yet unclassified') -----
+ testAddMinuteSecondDurations
+ 	self assert: (1 minute + 2 seconds = '0:00:01:02' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddMonthDayDurations (in category 'as yet unclassified') -----
+ testAddMonthDayDurations
+ 	self assert: (1 month + 2 days = (GenericDuration new + 1 month + 2 days))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddMonthYearDurations (in category 'as yet unclassified') -----
+ testAddMonthYearDurations
+ 	self assert: (1 month + 2 years = (GenericDuration new + 1 month + 2 years))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddNanoSecondSecondDurations (in category 'as yet unclassified') -----
+ testAddNanoSecondSecondDurations
+ 	self assert: (1 nanoSeconds + 2 seconds = '0:00:00:02.000000001' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddSecondMinuteDurations (in category 'as yet unclassified') -----
+ testAddSecondMinuteDurations
+ 	self assert: (1 second + 2 minutes = '0:00:02:01' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddSecondNanoSecondDurations (in category 'as yet unclassified') -----
+ testAddSecondNanoSecondDurations
+ 	self assert: (1 second + 2 nanoSeconds = '0:00:00:01.000000002' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testAddYearMonthDurations (in category 'as yet unclassified') -----
+ testAddYearMonthDurations
+ 	self assert: (1 year + 2 months = (GenericDuration new + 1 year + 2 months))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testDayDurationAssociativeSubtractionWithDateTime (in category 'as yet unclassified') -----
+ testDayDurationAssociativeSubtractionWithDateTime
+ 	self assert: (((DateAndTime year: 2014 month: 1 day: 31) - 1 hour - 1 day) 
+ 				= ((DateAndTime year: 2014 month: 1 day: 31) - (1 hour + 1 day)))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testDayDurationAssociativeWithDateTime (in category 'as yet unclassified') -----
+ testDayDurationAssociativeWithDateTime
+ 	self assert: (((DateAndTime year: 2014 month: 1 day: 31) + 1 hour + 1 day) 
+ 				= ((DateAndTime year: 2014 month: 1 day: 31) + (1 hour + 1 day)))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testGenericDurationAddition (in category 'as yet unclassified') -----
+ testGenericDurationAddition
+ 	self assert: (((1 month + 1 month) + (1 year + 1 year))
+ 			 = (1 month + 1 month + 1 year + 1 year))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testGenericDurationSubtraction (in category 'as yet unclassified') -----
+ testGenericDurationSubtraction
+ 	self assert: (((1 month + 1 month) - (1 year + 1 year))
+ 			 = (1 month + 1 month - 1 year - 1 year))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testMonthDurationAssociativeSubtractionWithDateTime (in category 'as yet unclassified') -----
+ testMonthDurationAssociativeSubtractionWithDateTime
+ 	self assert: (((DateAndTime year: 2014 month: 1 day: 31) - 1 month - 1 day)
+ 			 = ((DateAndTime year: 2014 month: 1 day: 31) - (1 month + 1 day)))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testMonthDurationAssociativeWithDateTime (in category 'as yet unclassified') -----
+ testMonthDurationAssociativeWithDateTime
+ 	self assert: (((DateAndTime year: 2014 month: 1 day: 31) + 1 month + 1 day)
+ 			 = ((DateAndTime year: 2014 month: 1 day: 31) + (1 month + 1 day)))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testMonthDurationNotCommutative (in category 'as yet unclassified') -----
+ testMonthDurationNotCommutative
+ 	self deny: ((1 month + 2 days) = (2 days + 1 month))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractDayDurations (in category 'as yet unclassified') -----
+ testSubtractDayDurations
+ 	self assert: (2 days - 1 day = 1 day)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractDayHourDurations (in category 'as yet unclassified') -----
+ testSubtractDayHourDurations
+ 	self assert: (1 day - 2 hours = '0:22:00:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractDayMonthDurations (in category 'as yet unclassified') -----
+ testSubtractDayMonthDurations
+ 	self assert: (1 day - 2 months = (GenericDuration new + 1 day - 2 months))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractHourDayDurations (in category 'as yet unclassified') -----
+ testSubtractHourDayDurations
+ 	self assert: (1 hour - 2 days = '-1:23:00:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractHourMinuteDurations (in category 'as yet unclassified') -----
+ testSubtractHourMinuteDurations
+ 	self assert: (1 hour - 2 minutes = '0:00:58:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractMinuteHourDurations (in category 'as yet unclassified') -----
+ testSubtractMinuteHourDurations
+ 	self assert: (1 minute - 2 hours = '-0:01:59:00' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractMinuteSecondDurations (in category 'as yet unclassified') -----
+ testSubtractMinuteSecondDurations
+ 	self assert: (1 minute - 2 seconds = '0:00:00:58' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractMonthDayDurations (in category 'as yet unclassified') -----
+ testSubtractMonthDayDurations
+ 	self assert: (1 month - 2 days = (GenericDuration new + 1 month - 2 days))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractMonthYearDurations (in category 'as yet unclassified') -----
+ testSubtractMonthYearDurations
+ 	self assert: (1 month - 2 years = (GenericDuration new + 1 month - 2 years))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractNanoSecondSecondDurations (in category 'as yet unclassified') -----
+ testSubtractNanoSecondSecondDurations
+ 	self assert: (1 nanoSeconds - 2 seconds = '-0:00:00:01.999999999' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractSecondMinuteDurations (in category 'as yet unclassified') -----
+ testSubtractSecondMinuteDurations
+ 	self assert: (1 second - 2 minutes = '-0:00:01:59' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractSecondNanoSecondDurations (in category 'as yet unclassified') -----
+ testSubtractSecondNanoSecondDurations
+ 	self assert: (1 second - 2 nanoSeconds = '0:00:00:00.999999998' asDuration)!

Item was added:
+ ----- Method: DurationArithmeticTest>>testSubtractYearMonthDurations (in category 'as yet unclassified') -----
+ testSubtractYearMonthDurations
+ 	self assert: (1 year - 2 months = (GenericDuration new + 1 year - 2 months))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testYearDurationAssociativeSubtractionWithDateTime (in category 'as yet unclassified') -----
+ testYearDurationAssociativeSubtractionWithDateTime
+ 	self assert: (((DateAndTime year: 2014 month: 1 day: 31) - 1 year - 1 day)
+ 			 = ((DateAndTime year: 2014 month: 1 day: 31) - (1 year + 1 day)))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testYearDurationAssociativeWithDateTime (in category 'as yet unclassified') -----
+ testYearDurationAssociativeWithDateTime
+ 	self assert: (((DateAndTime year: 2014 month: 1 day: 31) + 1 year + 1 day)
+ 			 = ((DateAndTime year: 2014 month: 1 day: 31) + (1 year + 1 day)))!

Item was added:
+ ----- Method: DurationArithmeticTest>>testYearDurationNotCommutative (in category 'as yet unclassified') -----
+ testYearDurationNotCommutative
+ 	self deny: ((1 year + 2 days) = (2 days + 1 year))!



More information about the Squeak-dev mailing list