From 9ebdd55f36c1c087e2e61fa5f3980dbc25f7d971 Mon Sep 17 00:00:00 2001 From: Eric Gonzalez Date: Tue, 26 Nov 2024 23:34:11 -0700 Subject: [PATCH] database: test heed get_range --- storage/database/src/backend/tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/database/src/backend/tests.rs b/storage/database/src/backend/tests.rs index 0c0fe056..b97693f7 100644 --- a/storage/database/src/backend/tests.rs +++ b/storage/database/src/backend/tests.rs @@ -360,7 +360,7 @@ fn tables_are_sorted() { // Insert range, assert each new // number inserted is the minimum `last()` value. for key in RANGE { - table.put(&key, &0).unwrap(); + table.put(&key, &(key as u64)).unwrap(); table.contains(&key).unwrap(); let (first, _) = table.first().unwrap(); let (last, _) = table.last().unwrap(); @@ -384,6 +384,9 @@ fn tables_are_sorted() { assert_eq!(i, iter); assert_eq!(iter, key); } + for (v, vv) in table.get_range(100..249).unwrap().zip(100..249) { + assert_eq!(v.unwrap(), vv); + } } let mut table = env_inner.open_db_rw::(&tx_rw).unwrap();