This commit is contained in:
2022-11-24 12:52:37 -08:00
parent a07ca5e34b
commit 4f6e7e6e2d
4 changed files with 97 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ auto render(std::array<std::uint8_t, 16> const& hash) -> std::string {
return out.str();
}
TEST_SUITE("knot hash") {
TEST_SUITE("knothash library") {
TEST_CASE("reverser") {
std::array<std::uint8_t, 9> v {0,1,2,3,4,5,6,7,8};
@@ -44,13 +44,13 @@ TEST_CASE("reverser") {
SUBCASE("more left") {
std::array<std::uint8_t, 9> expect {1,0,8,7,4,5,6,3,2};
reverser(v, 7, 6);
REQUIRE(v == expect);
CHECK(v == expect);
}
SUBCASE("more right") {
std::array<std::uint8_t, 9> expect {6,5,2,3,4,1,0,8,7};
reverser(v, 5, 6);
REQUIRE(v == expect);
CHECK(v == expect);
}
SUBCASE("middle") {