Skip to content

Commit 63d2cbc

Browse files
committed
Add unittest for parsing function declaration
1 parent 9dfe16f commit 63d2cbc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

inst/unitTests/cpp/attributes.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ std::string comments_test( /// // "\""" some '"// more / // ///garbge"
1010
) { // """
1111
return msg;
1212
}
13+
14+
std::string parse_declaration_test(std::string msg) {
15+
return msg;
16+
}
17+
18+
// [[Rcpp::export]]
19+
std::string parse_declaration_test(std::string msg = "Parse function declaration");

inst/unitTests/runit.attributes.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ if (.runThisTest) {
2828
comments_test(),
2929
"Start a C++ line comment with the characters \"//\""
3030
)
31+
checkEquals(
32+
parse_declaration_test(),
33+
"Parse function declaration"
34+
)
3135
}
3236

3337
}

0 commit comments

Comments
 (0)