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

commits at source.squeak.org commits at source.squeak.org
Fri Sep 19 06:22:18 UTC 2014


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

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

Name: KernelTests-cbc.278
Author: cbc
Time: 18 September 2014, 11:20:23.145 pm
UUID: db29e686-11d4-ae46-8c4d-e384ffab9bfa
Ancestors: KernelTests-cbc.277

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.
Fixed expectations for subtracting Timespans from DateAndTime instances.

=============== Diff against KernelTests-cbc.277 ===============

Item was changed:
  ----- Method: DateAndTimeArithmeticTest>>testAddTimespan (in category 'testing') -----
  testAddTimespan
+ 	self should: [((DateAndTime year: 2014 month: 1 day: 31) 
+ 		+ ((DateAndTime year: 2014 month: 1 day: 1) to: (DateAndTime year: 2014 month: 1 day: 3)))]
+ 		raise: Error
+ 		!
- 	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>>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 changed:
  ----- 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: 2014 month: 1 day: 3)))   		= ('30:00:00:00' asDuration)!
- 		- ((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>>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:
+ 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