33 lines
1.0 KiB
C
33 lines
1.0 KiB
C
#include "base.h"
|
|
|
|
#include "arena.h"
|
|
#include "string.h"
|
|
#include "hash-store.h"
|
|
|
|
#include "arena.c"
|
|
#include "string.c"
|
|
#include "hash-store.c"
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
Table store = hash_store_initialize();
|
|
Key a = hash_store_string8_to_key(&store, str8_lit("Hello"));
|
|
Key b = hash_store_string8_to_key(&store, str8_lit("Beautiful"));
|
|
Key c = hash_store_string8_to_key(&store, str8_lit("World"));
|
|
|
|
String8 str_a = hash_store_string8_from_key(&store, a);
|
|
String8 str_b = hash_store_string8_from_key(&store, b);
|
|
String8 str_c = hash_store_string8_from_key(&store, c);
|
|
|
|
ASSERT(hash_store_string8_to_key(&store, str8_lit("Hello")) == a);
|
|
ASSERT(hash_store_string8_to_key(&store, str8_lit("Beautiful")) == b);
|
|
ASSERT(hash_store_string8_to_key(&store, str8_lit("World")) == c);
|
|
|
|
ASSERT(string8_match(hash_store_string8_from_key(&store, a), str8_lit("Hello")));
|
|
ASSERT(string8_match(hash_store_string8_from_key(&store, b), str8_lit("Beautiful")));
|
|
ASSERT(string8_match(hash_store_string8_from_key(&store, c), str8_lit("World")));
|
|
|
|
return 0;
|
|
};
|