Skip to content

Commit 8ea3cc5

Browse files
committed
glayzzle#81 improve tests
1 parent cde46a9 commit 8ea3cc5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/precedence.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,24 @@ describe('Test precedence', function() {
119119
it('test + / *', function() {
120120
shouldBeSame('1 + 2 * 3', '1 + (2 * 3)');
121121
});
122-
it('test assign', function() {
123-
// https://github.com/glayzzle/php-parser/issues/81
122+
// https://github.com/glayzzle/php-parser/issues/81
123+
it('test assign with and', function() {
124124
shouldBeSame(
125125
'$a and $b = $c and $d',
126126
'($a and ($b = $c)) and $d'
127127
);
128128
});
129+
it('test assign list', function() {
130+
shouldBeSame(
131+
'$a = $b = $c',
132+
'($a = ($b = $c))'
133+
);
134+
});
135+
it('test assign with &&', function() {
136+
shouldBeSame(
137+
'$a && $b = $c && $d',
138+
'$a && ($b = ($c && $d))'
139+
);
140+
});
141+
129142
});

0 commit comments

Comments
 (0)