Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-hbrhbr committed Jul 30, 2024
1 parent 5990117 commit 51eb978
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
10 changes: 2 additions & 8 deletions components/core/src/clp/regex_utils/RegexErrorCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
#include <string>

#include <error_handling/ErrorCode.hpp>
//#include "GenericErrorCode.hpp"

namespace clp::error_handling {
template <>
auto clp::regex_utils::RegexErrorCategory::name() const noexcept -> char const* {
return "regex utility";
}

template <>
auto clp::regex_utils::RegexErrorCategory::message(int ev) const -> std::string {
switch (static_cast<clp::regex_utils::RegexErrorEnum>(ev)) {
auto clp::regex_utils::RegexErrorCategory::message(clp::regex_utils::RegexErrorEnum ev) const -> std::string {
switch (ev) {
case clp::regex_utils::RegexErrorEnum::Success:
return "Success.";

Expand All @@ -34,7 +32,3 @@ auto clp::regex_utils::RegexErrorCategory::message(int ev) const -> std::string
return "(unrecognized error)";
}
}
}

template class clp::error_handling::ErrorCategory<clp::regex_utils::RegexErrorEnum>;
template class clp::error_handling::ErrorCode<clp::regex_utils::RegexErrorEnum>;
3 changes: 0 additions & 3 deletions components/core/src/clp/regex_utils/RegexErrorCode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <system_error>

#include <error_handling/ErrorCode.hpp>
//#include "GenericErrorCode.hpp"

namespace clp::regex_utils {
enum class RegexErrorEnum : uint8_t {
Expand All @@ -26,8 +25,6 @@ enum class RegexErrorEnum : uint8_t {
TokenUnquantifiable,
};

//using RegexErrorCategory = clp::error_handling::ErrorCategory<RegexErrorEnum>;
//using RegexErrorCode = clp::error_handling::ErrorCode<RegexErrorEnum>;
using RegexErrorCategory = clp::error_handling::ErrorCategory<RegexErrorEnum>;
using RegexErrorCode = clp::error_handling::ErrorCode<RegexErrorEnum>;
} // namespace clp::regex_utils
Expand Down
2 changes: 1 addition & 1 deletion components/core/tests/test-regex_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST_CASE("regex_to_wildcard_simple_translations", "[regex_utils][re2wc][simple_

TEST_CASE("regex_to_wildcard_unescaped_metachar", "[regex_utils][re2wc][unescaped_metachar]") {
REQUIRE((regex_to_wildcard(".? xyz .* zyx .").error() == ErrorCode::UnsupportedQuestionMark));
//REQUIRE((regex_to_wildcard(". xyz .** zyx .").error() == RegexErrorCode{RegexErrorEnum::Star}));
REQUIRE((regex_to_wildcard(". xyz .** zyx .").error() == RegexErrorCode{RegexErrorEnum::Star}));
REQUIRE((regex_to_wildcard(". xyz .*+ zyx .").error() == ErrorCode::UntranslatablePlus));
REQUIRE((regex_to_wildcard(". xyz |.* zyx .").error() == ErrorCode::UnsupportedPipe));
REQUIRE((regex_to_wildcard(". xyz ^.* zyx .").error() == ErrorCode::IllegalCaret));
Expand Down

0 comments on commit 51eb978

Please sign in to comment.