Skip to content

Commit

Permalink
fix(tests): fix assumption that string.s is a char*
Browse files Browse the repository at this point in the history
  • Loading branch information
tomberek committed Sep 26, 2023
1 parent 9a78d87 commit 7e24dc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libexpr/tests/libexpr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace nix {
if (arg.type() != nString) {
return false;
}
return std::string_view(arg.string.s) == s;
return std::string_view(arg.c_str()) == s;
}

MATCHER_P(IsIntEq, v, fmt("The string is equal to \"%1%\"", v)) {
Expand Down Expand Up @@ -106,8 +106,8 @@ namespace nix {
if (arg.type() != nPath) {
*result_listener << "Expected a path got " << arg.type();
return false;
} else if (std::string_view(arg.string.s) != p) {
*result_listener << "Expected a path that equals \"" << p << "\" but got: " << arg.string.s;
} else if (std::string_view(arg._path) != p) {
*result_listener << "Expected a path that equals \"" << p << "\" but got: " << arg.c_str();
return false;
}
return true;
Expand Down

0 comments on commit 7e24dc6

Please sign in to comment.