Adds new StringViewDictionary with specialized methods to retrieve values by the hash of the StringView
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <doctest.h>
|
||||
#include "../src/Collections/Dictionary.hpp"
|
||||
#include "../src/Collections/StringViewDictionary.hpp"
|
||||
using namespace ArbUt;
|
||||
|
||||
TEST_CASE("Create Dictionary, insert values") {
|
||||
@@ -107,4 +108,14 @@ TEST_CASE("Create Dictionary with different types, insert values, iterate over k
|
||||
CHECK(i == 3);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Create StringViewDictionary, insert values, get values by hash") {
|
||||
auto dic = StringViewDictionary<i32>(5);
|
||||
dic.Insert("foo"_cnc, 5);
|
||||
dic.Insert("bar"_cnc, 100);
|
||||
dic.Insert("zet"_cnc, 2000);
|
||||
|
||||
CHECK(dic.GetFromHash("bar"_cnc) == 100);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user