Add table tests

This commit is contained in:
Krzosa Karol
2023-12-31 16:41:02 +01:00
parent b3f5ce3772
commit 0a81270278
6 changed files with 87 additions and 19 deletions

View File

@@ -112,11 +112,27 @@ void TestReverseLoop() {
array.dealloc();
}
void TestCopy() {
MA_Scratch scratch;
auto a = GenArray();
auto b = a.tight_copy(scratch);
auto c = a.copy(scratch);
int i = 0;
For(b) IO_Assert(it == i++);
i = 0;
For(c) IO_Assert(it == i++);
IO_Assert(b.cap == b.len && b.len == a.len);
IO_Assert(a.len == c.len && a.cap == c.cap);
}
int main() {
TestExclusiveArenaBackedArray();
TestRemoveForLoop();
TestBasic();
TestReverseLoop();
TestCopy();
return 0;
}