nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit d5aeed4abd44291021834e7b08569b8205266cd0
parent 62fd097bb3f751b51292f7a317b615030193032a
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  4 Dec 2023 14:27:27 -0800

test: "fix" search test

Diffstat:
Mtest.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test.c b/test.c @@ -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)); @@ -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);