From 663f9f347a25b4d771ebe0e3999e773e7fee0450 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Sun, 5 Jan 2025 11:43:31 +0200 Subject: [PATCH] test: improve dbfs tests - Remove a placeholder panic in `dbfs_test.v`. - Improve `namedb_test.v` by using `get_from_id` to retrieve public keys by ID and then using `get` to retrieve the data associated with the public key. This better reflects the intended usage and clarifies the test. Co-authored-by: supermario --- lib/data/dbfs/dbfs_test.v | 2 -- lib/data/dbfs/namedb_test.v | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/data/dbfs/dbfs_test.v b/lib/data/dbfs/dbfs_test.v index 620e2239..ddf686b2 100644 --- a/lib/data/dbfs/dbfs_test.v +++ b/lib/data/dbfs/dbfs_test.v @@ -35,8 +35,6 @@ fn test_dbfs3() { withkeys: true keyshashed: true )! - - panic('need other test') } fn dotest(mut db DB, mut dbcollection DBCollection) ! { diff --git a/lib/data/dbfs/namedb_test.v b/lib/data/dbfs/namedb_test.v index bea83f95..fda5fcbf 100644 --- a/lib/data/dbfs/namedb_test.v +++ b/lib/data/dbfs/namedb_test.v @@ -44,8 +44,8 @@ fn test_dbname1() { // Retrieve public keys using their unique IDs console.print_debug('retrieve starts') for i2, myid in ids { - retrieved_pubkey, data := ndb.get(myid)! - myid_found, data_found := ndb.getdata(retrieved_pubkey)! + retrieved_pubkey, data := ndb.get_from_id(myid)! + myid_found, data_found := ndb.get(retrieved_pubkey)! assert myid_found == myid assert data_found == data tc := test_cases[i2] or {