mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(string): add SStrHashHT
This commit is contained in:
parent
f631bdac3b
commit
abb9e8ed79
6 changed files with 277 additions and 0 deletions
20
test/String.cpp
Normal file
20
test/String.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue