--- a/ParserTests.st Wed Apr 17 09:08:38 2013 +0200
+++ b/ParserTests.st Thu Apr 18 14:27:49 2013 +0200
@@ -1670,6 +1670,30 @@
self deny:parser == #Error.
self assert:parser comments size == 1.
self assert:parser comments first commentString = '>>END\bla\bla bla\END\' withCRs.
+!
+
+test_120_scan_numbers
+ |s n|
+
+ n := Scanner scanNumberFrom:(s := ReadStream on:'0').
+ self assert:(n == 0).
+ self assert:(s position == 1).
+
+ n := Scanner scanNumberFrom:(s := ReadStream on:'1234 ').
+ self assert:(n == 1234).
+ self assert:(s position == 4).
+
+ n := Scanner scanNumberFrom:(s := ReadStream on:'1234.0 ').
+ self assert:(n = 1234.0).
+ self assert:(s position == 6).
+
+ n := Scanner scanNumberFrom:(s := ReadStream on:'1234/ ').
+ self assert:(n = 1234).
+ self assert:(s position == 4).
+
+ n := Scanner scanNumberFrom:(s := ReadStream on:'1234/2 ').
+ self assert:(n = (1234/2)).
+ self assert:(s position == 6).
! !
!ParserTests methodsFor:'tests - sysprim'!