squall/test/String.cpp

21 lines
615 B
C++
Raw Normal View History

2020-11-14 17:18:49 -06:00
#include "storm/String.hpp"
#include "test/Test.hpp"
TEST_CASE("SStrHashHT", "[string]") {
SECTION("hashes simple string correctly") {
auto hash = SStrHashHT("foo");
REQUIRE(hash == 1371562358u);
}
SECTION("hashes string with forward slash correctly") {
auto hash = SStrHashHT("foo/bar");
REQUIRE(hash == 2270424393u);
}
SECTION("hashes string with forward slash equivalent to back slash") {
auto hashForwardSlash = SStrHashHT("foo/bar");
auto hashBackSlash = SStrHashHT("foo\\bar");
REQUIRE(hashForwardSlash == hashBackSlash);
}
}