@@ -168,6 +168,13 @@ static void combineOperators_coloncolon()
168168 ASSERT_EQUALS (" x ? y : :: z" , preprocess (" x ? y : ::z" ));
169169}
170170
171+ static void combineOperators_andequal ()
172+ {
173+ ASSERT_EQUALS (" x &= 2 ;" , preprocess (" x &= 2;" ));
174+ ASSERT_EQUALS (" void f ( x & = 2 ) ;" , preprocess (" void f(x &= 2);" ));
175+ ASSERT_EQUALS (" f ( x &= 2 ) ;" , preprocess (" f(x &= 2);" ));
176+ }
177+
171178static void comment ()
172179{
173180 ASSERT_EQUALS (" // abc" , readfile (" // abc" ));
@@ -612,7 +619,8 @@ static void hashhash8()
612619 ASSERT_EQUALS (" \n xy = 123 ;" , preprocess (code));
613620}
614621
615- static void hashhash_invalid_1 () {
622+ static void hashhash_invalid_1 ()
623+ {
616624 std::istringstream istr (" #define f(a) (##x)\n f(1)" );
617625 std::vector<std::string> files;
618626 std::map<std::string, simplecpp::TokenList*> filedata;
@@ -622,7 +630,8 @@ static void hashhash_invalid_1() {
622630 ASSERT_EQUALS (" file0,1,syntax_error,failed to expand 'f', Invalid ## usage when expanding 'f'.\n " , toString (outputList));
623631}
624632
625- static void hashhash_invalid_2 () {
633+ static void hashhash_invalid_2 ()
634+ {
626635 std::istringstream istr (" #define f(a) (x##)\n f(1)" );
627636 std::vector<std::string> files;
628637 std::map<std::string, simplecpp::TokenList*> filedata;
@@ -1484,6 +1493,7 @@ int main(int argc, char **argv)
14841493 TEST_CASE (combineOperators_floatliteral);
14851494 TEST_CASE (combineOperators_increment);
14861495 TEST_CASE (combineOperators_coloncolon);
1496+ TEST_CASE (combineOperators_andequal);
14871497
14881498 TEST_CASE (comment);
14891499 TEST_CASE (comment_multiline);
0 commit comments