seahag/test/create_dir_node.c
Nathan Fisher 7671e9e29e Add test for creating a symlink node and change to using lstat
instead of `stat` to check file type.
2023-09-15 01:49:16 -04:00

20 lines
No EOL
464 B
C

#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "haggis.h"
int main() {
haggis_linkmap *map;
haggis_node *node;
char *path = "output";
map = haggis_linkmap_init();
assert(map != NULL);
node = haggis_create_node(path, sha256, map);
assert(node->filetype.tag == directory);
assert(memcmp(path, node->name.name, 6) == 0);
haggis_node_deinit(node);
haggis_linkmap_deinit(map);
return 0;
}