blob: 7b37e0d74982cdece70e2dc62963d2180aed107d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "string.h"
#include "testing.h"
i32 test_string_literal_equality() {
t_assert(Str_equals(S("Bonjour"), S("Bonjour")));
return 0;
}
i32 test_string_copy() {
Arena perm = Arena_new(128e3);
Str src = S("Hello");
Str *cpy = Str_copy(&perm, src.data, src.len);
t_assert(Str_equals(src, *cpy));
t_assert_equal(Arena_get_used(perm), 21);
return 0;
}
|