Skip to content

Commit

Permalink
add validations for empty name and fqn, to make sure this kind of bug…
Browse files Browse the repository at this point in the history
… doesn't fall through the cracks
  • Loading branch information
OmerMajNition committed Oct 30, 2024
1 parent 1633b41 commit 8805037
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/Cpp/src/FqnTest.lf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ target Cpp {

public preamble {=
inline bool name_validation (const std::string& fqn, const std::string& name) {
if (fqn.empty() || name.empty()) {
return false;
}
size_t last_dot = fqn.find_last_of('.');
return (last_dot == std::string::npos) ? (name == fqn) : (name == fqn.substr(last_dot + 1));
}
Expand Down

0 comments on commit 8805037

Please sign in to comment.