Skip to content

Commit 9e62537

Browse files
committed
Amended tests
1 parent 1e78d34 commit 9e62537

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

tests/operators/bug89.phpt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
--TEST--
2+
Tests bitwise operators priority
3+
--SKIPIF--
4+
<?php include(__DIR__ . '/../skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
$code =<<<ZEP
9+
function test () {
10+
let t = u & v << 7;
11+
}
12+
ZEP;
13+
14+
echo json_encode(
15+
zephir_parse_file($code, '(eval code)'),
16+
JSON_PRETTY_PRINT
17+
);
18+
19+
?>
20+
--EXPECT--
21+
[
22+
{
23+
"type": "function",
24+
"name": "test",
25+
"statements": [
26+
{
27+
"type": "let",
28+
"assignments": [
29+
{
30+
"assign-type": "variable",
31+
"operator": "assign",
32+
"variable": "t",
33+
"expr": {
34+
"type": "bitwise_and",
35+
"left": {
36+
"type": "variable",
37+
"value": "u",
38+
"file": "(eval code)",
39+
"line": 2,
40+
"char": 15
41+
},
42+
"right": {
43+
"type": "bitwise_shiftleft",
44+
"left": {
45+
"type": "variable",
46+
"value": "v",
47+
"file": "(eval code)",
48+
"line": 2,
49+
"char": 20
50+
},
51+
"right": {
52+
"type": "int",
53+
"value": "7",
54+
"file": "(eval code)",
55+
"line": 2,
56+
"char": 23
57+
},
58+
"file": "(eval code)",
59+
"line": 2,
60+
"char": 23
61+
},
62+
"file": "(eval code)",
63+
"line": 2,
64+
"char": 23
65+
},
66+
"file": "(eval code)",
67+
"line": 2,
68+
"char": 23
69+
}
70+
],
71+
"file": "(eval code)",
72+
"line": 3,
73+
"char": 1
74+
}
75+
],
76+
"file": "(eval code)",
77+
"line": 1,
78+
"char": 9
79+
}
80+
]

0 commit comments

Comments
 (0)