Squeak Class Documentation category index | class index  
 
TimeTestCase
  category: Kernel-Magnitudes-Tests
  superclass: TestCase
  subclasses:

No comment. Sorry.

instance methods
  comparing
  comparePrintStreamFor:hr24:showSeconds:expected:
hoursShould:for:
minutesShould:for:
secondsShould:for:

  testing
  testHours
testMinutes
testPrintNegativeTime
testPrintPositiveTime
testSeconds

class methods
  no messages
 

instance methods
  comparing top  
 

comparePrintStreamFor:hr24:showSeconds:expected:


 

hoursShould:for:


 

minutesShould:for:


 

secondsShould:for:


  testing top  
 

testHours


 

testMinutes


 

testPrintNegativeTime

UnitTest for [BUG] Printing Time

Description:

I'm not sure if this is a bug or 'as designed', but when you do any
arithmetic with time objects (especially subtraction) and the seconds
go negative (before midnight), when you print out the time you either
always get 12 am or something interesting if you are printing 24-hour
time.

A simple fix in the method print24:showSeconds:on: would be to
instead of initializing the local variable h to self hours,
initialize h to self hours \\ 24.


 

testPrintPositiveTime


 

testSeconds


class methods
  no messages top