Skip to content

Commit

Permalink
[TCling] Add unit test for GetCppName
Browse files Browse the repository at this point in the history
  • Loading branch information
devajithvs committed May 2, 2024
1 parent 99ada8a commit 0f8f2fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/clingutils/test/TClingUtilsTests.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,13 @@ TEST(TClingUtilsTests, GetRealPath)
std::remove("./symlink_realfile2");
std::remove("./realfile1");
std::remove("./realfile2");

// Test for converting a string to a valid C/C++ variable name
std::string validVarName;
GetCppName(validVarName,
"some+input-string*with/special&characters123+-*/&%|^><=~.()[]{};#?`!,$:\"@\'\\@abc$and spaces");
ASSERT_EQ(validVarName, "somepLinputmIstringmUwithdIspecialaNcharacters123pLmImUdIaNpEoRhAgRlEeQwAdOoPcPoBcBlBrBsChS"
"qMbTnOcOdAcLdQaTsQfIaTabcdAandsPspaces");

#endif // not R__WIN32
}

0 comments on commit 0f8f2fe

Please sign in to comment.