1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

string: faster int()

This commit is contained in:
Alexander Medvednikov
2019-10-25 23:41:18 +03:00
parent 5510327d70
commit dc2c62807a
3 changed files with 31 additions and 0 deletions

View File

@@ -482,3 +482,13 @@ fn test_escape() {
//println("\"$a")
}
fn test_atoi() {
assert '234232'.int() == 234232
assert '-9009'.int() == -9009
assert '0'.int() == 0
for n in -10000 .. 100000 {
s := n.str()
assert s.int() == n
}
}