Skip to content

Commit 99eda7b

Browse files
committed
test: update
1 parent 01a54ec commit 99eda7b

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

tests/syntax_tests/data/parsing/grammar/expressions/binary.res

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,14 @@ let x = a + -1 + -2
2929
let x = a + @attr -1 + @attr -2
3030
let x = a % a == 0
3131
let x = a ^ a == 0
32+
let x = a << a == 0
33+
let x = a >> a == 0
34+
3235

3336
// should be interpreted as binary expression not prefix op
3437
let x = a -b
3538
let x = a -.b
3639

37-
// shift operators
38-
let x = a << b
39-
let x = a >> b
40-
let x = a >>> b
41-
let x = a << b + c
42-
let x = a + b << c
43-
let x = a >> b + c
44-
let x = a + b >> c
45-
let x = a >>> b + c
46-
let x = a + b >>> c
47-
4840
// not binary expr
4941
Constructor(a, b)
5042
#Constructor(a, b)

tests/syntax_tests/data/printer/expr/binary.res

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ x + y / z
5555
x / y + z
5656
x % y * z
5757
x ^ y + z
58+
x << y + z
59+
x >> y + z
5860
100 * x / total
5961
2 / 3 * 10 / 2 + 2
6062
let rotateX = ((range / rect.height) * refY - range / 2) * getXMultiplication(rect.width)
@@ -409,14 +411,3 @@ let make = (~keycap) =>
409411
(@doesNotRaise [])->Belt.Array.getExn(0)
410412
@doesNotRaise
411413
[]->Belt.Array.getExn(0)
412-
413-
// shift operators
414-
let x = a << b
415-
let x = a >> b
416-
let x = a >>> b
417-
let x = a << b + c
418-
let x = a + b << c
419-
let x = a >> b + c
420-
let x = a + b >> c
421-
let x = a >>> b + c
422-
let x = a + b >>> c

tests/tests/src/belt_int_test.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ describe(__MODULE__, () => {
4242
eq(__LOC__, 2 / 3, 0)
4343
eq(__LOC__, 2 % 2, 0)
4444
eq(__LOC__, 2 ^ 3, 1)
45+
eq(__LOC__, 2 << 3, 16)
46+
eq(__LOC__, 16 >> 3, 2)
4547
})
4648
})

tests/tests/src/unified_ops_test.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ let bxor_bigint = (a: bigint, b) => a ^ b
3232

3333
let shl_int = 1 << 2
3434
let shr_int = 8 >> 2
35-
let ushr_int = -1 >>> 1
3635

3736
let shl_bigint = 1n << 2n
37+
let shr_bigint = 8n >> 2n

0 commit comments

Comments
 (0)