mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
builtin: test left/right shift precedence
This commit is contained in:
parent
50871d1a92
commit
0c63f5c80d
2 changed files with 23 additions and 0 deletions
|
@ -692,6 +692,19 @@ fn test_hex(){
|
|||
assert st1.hex() == "41".repeat(100)
|
||||
}
|
||||
|
||||
fn test_left_shift_precendence() {
|
||||
mut arr := []int
|
||||
arr << 1 + 1
|
||||
arr << 1 - 1
|
||||
arr << 2 / 1
|
||||
arr << 2 * 1
|
||||
|
||||
assert arr[0] == 2
|
||||
assert arr[1] == 0
|
||||
assert arr[2] == 2
|
||||
assert arr[3] == 2
|
||||
}
|
||||
|
||||
fn test_array_with_cap() {
|
||||
a := []int{cap:10, len:1 }
|
||||
//assert a.len == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue