forked from Mirror/wren
Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will also be useful when there are tests of the embedding API.
This commit is contained in:
23
test/language/bitwise_precedence.wren
Normal file
23
test/language/bitwise_precedence.wren
Normal file
@ -0,0 +1,23 @@
|
||||
// << have higher precedence than |.
|
||||
IO.print(2 | 1 << 1) // expect: 2
|
||||
IO.print(1 << 1 | 2) // expect: 2
|
||||
|
||||
// << has higher precedence than &.
|
||||
IO.print(2 & 1 << 1) // expect: 2
|
||||
IO.print(1 << 1 & 2) // expect: 2
|
||||
|
||||
// << has higher precedence than ^.
|
||||
IO.print(2 ^ 1 << 1) // expect: 0
|
||||
IO.print(1 << 1 ^ 2) // expect: 0
|
||||
|
||||
// & has higher precedence than |.
|
||||
IO.print(1 & 1 | 2) // expect: 3
|
||||
IO.print(2 | 1 & 1) // expect: 3
|
||||
|
||||
// & has higher precedence than ^.
|
||||
IO.print(1 & 1 ^ 2) // expect: 3
|
||||
IO.print(2 ^ 1 & 1) // expect: 3
|
||||
|
||||
// ^ has higher precedence than |.
|
||||
IO.print(1 ^ 1 | 1) // expect: 1
|
||||
IO.print(1 | 1 ^ 1) // expect: 1
|
||||
Reference in New Issue
Block a user