1
0
mirror of https://github.com/janet-lang/janet synced 2025-12-16 21:48:06 +00:00

More work. Too many changes to be listed.

This commit is contained in:
bakpakin
2017-11-05 22:05:47 -05:00
parent a2ee028bd5
commit f6dcb07c8d
34 changed files with 2163 additions and 2133 deletions

17
unittests/array_test.c Normal file
View File

@@ -0,0 +1,17 @@
#include "unit.h"
#include <dst/dst.h>
int main() {
int64_t i;
DstArray *array = dst_array(10);
assert(array->capacity == 10);
assert(array->count == 0);
for (i = 0; i < 500; ++i)
dst_array_push(array, dst_wrap_integer(i));
for (i = 0; i < 500; ++i)
assert(array->data[i].type == DST_INTEGER && array->data[i].as.integer == i);
for (i = 0; i < 200; ++i)
dst_array_pop(array);
assert(array->count == 300);
return 0;
}