Skip to content

Commit

Permalink
fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Jan 31, 2025
1 parent d1a31c0 commit e7d6f50
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Manifest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ static const fs::path GIT_SRC_DIR(GIT_DIR / "src");
static const std::unordered_set<char> ALLOWED_CHARS = {
'-', '_', '/', '.', '+' // allowed in the dependency name
};
static const std::unordered_set<std::string_view> KEYWORDS = {
#include "Keywords.def"
};

Result<Edition>
Edition::tryFromString(std::string str) noexcept {
Expand Down Expand Up @@ -550,7 +547,11 @@ validatePackageName(const std::string_view name) noexcept {
std::isalnum(name[name.size() - 1]),
"package name must end with a letter or digit"
);
Ensure(!KEYWORDS.contains(name), "package name must not be a C++ keyword");

static const std::unordered_set<std::string_view> keywords = {
#include "Keywords.def"
};
Ensure(!keywords.contains(name), "package name must not be a C++ keyword");

return Ok();
}
Expand Down Expand Up @@ -1076,6 +1077,8 @@ testValidateDepName() {

int
main() {
cabin::setColorMode("never");

tests::testEditionTryFromString();
tests::testEditionComparison();
tests::testPackageTryFromToml();
Expand Down

0 comments on commit e7d6f50

Please sign in to comment.