mirror of
https://github.com/janet-lang/janet
synced 2024-11-18 14:44:48 +00:00
2771171658
up code. Generalized some vector code.
20 lines
575 B
C
20 lines
575 B
C
#include "unit.h"
|
|
#include <dst/dst.h>
|
|
|
|
int main() {
|
|
dst_init();
|
|
DstTable *table = dst_table(10);
|
|
assert(table->count == 0);
|
|
dst_table_put(table, dst_cstringv("a"), dst_cstringv("b"));
|
|
dst_table_put(table, dst_cstringv("b"), dst_cstringv("a"));
|
|
dst_table_put(table, dst_cstringv("a"), dst_cstringv("c"));
|
|
assert(table->count == 2);
|
|
dst_table_remove(table, dst_cstringv("a"));
|
|
assert(table->count == 1);
|
|
assert(dst_equals(
|
|
dst_table_get(table, dst_cstringv("b")),
|
|
dst_cstringv("a")
|
|
));
|
|
return 0;
|
|
}
|