Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Sep 15, 2023
1 parent 0405f53 commit ea9c537
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,19 @@ static void define12()
"} ;", preprocess(code));
}

static void define13()
{
const char code[] = "#define M 180.\n"
"extern void g();\n"
"void f(double d) {\n"
" if (d > M) {}\n"
"}\n";
ASSERT_EQUALS("\nextern void g ( ) ;\n"
"void f ( double d ) {\n"
"if ( d > 180. ) { }\n"
"}", preprocess(code));
}



static void define_invalid_1()
Expand Down Expand Up @@ -2646,6 +2659,7 @@ int main(int argc, char **argv)
TEST_CASE(define10);
TEST_CASE(define11);
TEST_CASE(define12);
TEST_CASE(define13);
TEST_CASE(define_invalid_1);
TEST_CASE(define_invalid_2);
TEST_CASE(define_define_1);
Expand Down

0 comments on commit ea9c537

Please sign in to comment.