mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: make 0o
prefix the only way to define octals
This commit is contained in:
@ -117,6 +117,20 @@ fn test_hex() {
|
||||
fn test_oct() {
|
||||
x1 := 0o12
|
||||
assert x1 == 10
|
||||
x2 := 012
|
||||
assert x2 == 10
|
||||
x2 := 00000o350
|
||||
assert x2 == 232
|
||||
x3 := 000o00073
|
||||
assert x3 == 59
|
||||
x4 := 00000000
|
||||
assert x4 == 0
|
||||
x5 := 00000195
|
||||
assert x5 == 195
|
||||
x6 := -0o744
|
||||
assert x6 == -484
|
||||
x7 := -000o000042
|
||||
assert x7 == -34
|
||||
x8 := -0000112
|
||||
assert x8 == -112
|
||||
x9 := -000
|
||||
assert x9 == 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user