Mantis - Squeak
Viewing Issue Advanced Details
6764 Kernel minor always 11-12-07 21:47 04-18-10 22:05
nicolas cellier  
andreas  
normal  
closed 3.10  
fixed  
none    
none trunk  
0006764: Duration class>>#readFrom: does not like trailing characters
self should:
 (Duration readFrom: '0:00:00:00.001 ') nanoSeconds = 1000000.

current answer is 1...

To me, advantage of a Stream is to be able to decode up to irrelevant characters, and leave stream positionned for a next read...
That's my understanding of readFrom:

At least, i would expect a reading Error (or nil with a preference for Error) rather than a ... surprising result.

Notes
(0013294)
tfel   
09-02-09 09:12   
I uploaded a fix for that to the inbox (Kernel-tfel.236). It reads up to the spac, leaves the Stream at that position and yields the proper result.
(0013295)
andreas   
09-03-09 03:01   
http://source.squeak.org/trunk/Kernel-tfel.236.mcz [^]
http://source.squeak.org/trunk/KernelTests-ar.90.mcz [^]