@@ -8,7 +8,9 @@ class OperatorWhitespaceCheckTest extends CheckTestCase<OperatorWhitespaceCheckT
88 static inline var MSG_EQUALS_BEFORE : String = ' OperatorWhitespace policy "before" violated by "="' ;
99 static inline var MSG_EQUALS_AFTER : String = ' OperatorWhitespace policy "after" violated by "="' ;
1010 static inline var MSG_UNARY_NONE : String = ' OperatorWhitespace policy "none" violated by "++"' ;
11+ static inline var MSG_UNARY_NONE_BITWISE : String = ' OperatorWhitespace policy "none" violated by "~"' ;
1112 static inline var MSG_UNARY_INNER : String = ' OperatorWhitespace policy "inner" violated by "++"' ;
13+ static inline var MSG_UNARY_INNER_BITWISE : String = ' OperatorWhitespace policy "inner" violated by "~"' ;
1214 static inline var MSG_INTERVAL_NONE : String = ' OperatorWhitespace policy "none" violated by "..."' ;
1315 static inline var MSG_INTERVAL_AROUND : String = ' OperatorWhitespace policy "around" violated by "..."' ;
1416 static inline var MSG_FUNC_ARG_AROUND : String = ' OperatorWhitespace policy "around" violated by "->"' ;
@@ -37,6 +39,7 @@ class OperatorWhitespaceCheckTest extends CheckTestCase<OperatorWhitespaceCheckT
3739 assertNoMsg (check , OPGT );
3840 assertNoMsg (check , MACRO_TYPES );
3941 assertNoMsg (check , MACRO_NOT );
42+ assertNoMsg (check , BITWISE_NEG );
4043 }
4144
4245 public function testIncorrectOperatorWhitespaceToken () {
@@ -90,10 +93,14 @@ class OperatorWhitespaceCheckTest extends CheckTestCase<OperatorWhitespaceCheckT
9093
9194 assertNoMsg (check , UNARY_NO_WHITESPACE );
9295 assertMsg (check , UNARY_INNER_WHITESPACE , MSG_UNARY_NONE );
96+ assertNoMsg (check , BITWISE_NEG );
97+ assertMsg (check , BITWISE_NEG_WRONG , MSG_UNARY_NONE_BITWISE );
9398
9499 check .unaryOpPolicy = INNER ;
95100 assertMsg (check , UNARY_NO_WHITESPACE , MSG_UNARY_INNER );
96101 assertNoMsg (check , UNARY_INNER_WHITESPACE );
102+ assertMsg (check , BITWISE_NEG , MSG_UNARY_INNER_BITWISE );
103+ assertNoMsg (check , BITWISE_NEG_WRONG );
97104 }
98105
99106 public function testInterval () {
@@ -471,4 +478,18 @@ abstract OperatorWhitespaceCheckTests(String) to String {
471478 function test() {
472479 }
473480 }" ;
481+
482+ var BITWISE_NEG = "
483+ class Test {
484+ function test() {
485+ var test = ~test;
486+ }
487+ }" ;
488+
489+ var BITWISE_NEG_WRONG = "
490+ class Test {
491+ function test() {
492+ var test = ~ test;
493+ }
494+ }" ;
474495}
0 commit comments