Skip to content

Commit 4645366

Browse files
authored
added testcases for #346 (#347)
1 parent 6d2c377 commit 4645366

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/checks/whitespace/OperatorWhitespaceCheckTest.hx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ class OperatorWhitespaceCheckTest extends CheckTestCase<OperatorWhitespaceCheckT
9696
assertNoMsg(check, BITWISE_NEG);
9797
assertMsg(check, BITWISE_NEG_WRONG, MSG_UNARY_NONE_BITWISE);
9898

99+
check.unaryOpPolicy = NONE;
100+
assertNoMsg(check, UNARY_NO_WHITESPACE);
101+
assertMsg(check, UNARY_INNER_WHITESPACE, MSG_UNARY_NONE);
102+
assertNoMsg(check, BITWISE_NEG);
103+
assertMsg(check, BITWISE_NEG_WRONG, MSG_UNARY_NONE_BITWISE);
104+
99105
check.unaryOpPolicy = INNER;
100106
assertMsg(check, UNARY_NO_WHITESPACE, MSG_UNARY_INNER);
101107
assertNoMsg(check, UNARY_INNER_WHITESPACE);
@@ -398,8 +404,10 @@ abstract OperatorWhitespaceCheckTests(String) to String {
398404
class Test {
399405
function test() {
400406
if (!test) return a++;
407+
if ( !test ) return a++;
401408
++a;
402409
return !(a++);
410+
return !( a++ );
403411
}
404412
}";
405413

0 commit comments

Comments
 (0)