Skip to content

Commit

Permalink
test: "fix" search test
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Dec 4, 2023
1 parent 62fd097 commit d5aeed4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,9 @@ static void test_fulltext()
char *json = malloc(alloc_size);
struct ndb_text_search_results results;
struct ndb_config config;
struct ndb_text_search_config search_config;
ndb_default_config(&config);
ndb_default_text_search_config(&search_config);

assert(ndb_init(&ndb, test_dir, &config));

Expand All @@ -956,8 +958,8 @@ static void test_fulltext()
ndb_begin_query(ndb, &txn);
ndb_text_search(&txn, "Jump Over", &results, NULL);
fprintf(stderr, "num results %d\n", results.num_results);
assert(results.num_results == 2);
assert(!strcmp(results.results[0].key.str, "jumped"));
assert(results.num_results == 1);
assert(!strncmp(results.results[0].key.str, "over", 4));
ndb_end_query(&txn);

ndb_destroy(ndb);
Expand Down

0 comments on commit d5aeed4

Please sign in to comment.