Merge pull request #205457 from h7x4/lib-strings-toInt-broken-for-negative-numbers
lib.strings: fix negative number handling for `toInt` and `toIntBase10`
This commit is contained in:
@@ -339,6 +339,8 @@ runTests {
|
||||
(0 == toInt " 0")
|
||||
(0 == toInt "0 ")
|
||||
(0 == toInt " 0 ")
|
||||
(-1 == toInt "-1")
|
||||
(-1 == toInt " -1 ")
|
||||
];
|
||||
|
||||
testToIntFails = testAllTrue [
|
||||
@@ -383,6 +385,8 @@ runTests {
|
||||
(0 == toIntBase10 " 000000")
|
||||
(0 == toIntBase10 "000000 ")
|
||||
(0 == toIntBase10 " 000000 ")
|
||||
(-1 == toIntBase10 "-1")
|
||||
(-1 == toIntBase10 " -1 ")
|
||||
];
|
||||
|
||||
testToIntBase10Fails = testAllTrue [
|
||||
|
||||
Reference in New Issue
Block a user