diff --git a/src/kjv.re_c.c b/src/kjv.re_c.c index ac77711..da03523 100644 --- a/src/kjv.re_c.c +++ b/src/kjv.re_c.c @@ -164,7 +164,9 @@ void kjv_(struct kjv *const kjv) { verse_table_(&kjv->verses); } -/** Loads 66 files from the "kjv/" directory. */ +/** Loads 66 files from the "kjv/" directory. Prints out something if it + doesn't work, but does not call `perror` or reset `errno`. Use + to tell. */ struct kjv kjv(void) { const char *const dir_kjv = "kjv"; struct text backing; diff --git a/test/test_kjv.c b/test/test_kjv.c index 0ff16a0..65efd7f 100644 --- a/test/test_kjv.c +++ b/test/test_kjv.c @@ -2,6 +2,7 @@ #include #include /* C99 */ #include +#include int main(void) { int success = EXIT_SUCCESS; @@ -12,6 +13,8 @@ int main(void) { kjv_add(&k, (union kjvcite){ .book = Genesis, .chapter = 1, .verse = 2 }); kjv_add(&k, (union kjvcite){ .book = Genesis, .chapter = 1, .verse = 1 }); fprintf(stderr, "%zu of which: %s.\n", k.set_words, kjv_set_to_string(&k)); + assert(k.total_words == 789633); + assert(k.set_words == 39); goto finally; catch: success = EXIT_FAILURE, perror("kjv");