lib/core: fix `Text::is_int`
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 19 Apr 2016 17:44:06 +0000 (13:44 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 19 Apr 2016 20:12:54 +0000 (16:12 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/core/fixed_ints.nit

index 36f21a3..c643eee 100644 (file)
@@ -899,6 +899,7 @@ redef class Text
        #     assert not "0x_".is_int
        #     assert not "0xGE".is_int
        #     assert not "".is_int
+       #     assert not "Not an Int".is_int
        fun is_int: Bool do
                if bytelen == 0 then return false
                var s = remove_all('_')
@@ -913,7 +914,7 @@ redef class Text
                if hd == "0x" or hd == "0X" then return rets.is_hex
                if hd == "0b" or hd == "0B" then return rets.is_bin
                if hd == "0o" or hd == "0O" then return rets.is_oct
-               return hd.is_dec
+               return rets.is_dec
        end
 
        redef fun to_i