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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user