From 2ba461b0ad2e10985ff8944661d4d3758bbca33e Mon Sep 17 00:00:00 2001 From: Jiaqi Shen <18863662628@163.com> Date: Sat, 25 May 2024 09:18:56 +0800 Subject: [PATCH] [test]: Modify test_sst_build_all() to add checks for first_key and last_key of SST (#76) Signed-off-by: Alex Chi Co-authored-by: shenjiaqi.2769 Co-authored-by: Alex Chi --- mini-lsm/src/tests/week1_day4.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mini-lsm/src/tests/week1_day4.rs b/mini-lsm/src/tests/week1_day4.rs index 7f0cfd32..efbb1006 100644 --- a/mini-lsm/src/tests/week1_day4.rs +++ b/mini-lsm/src/tests/week1_day4.rs @@ -55,7 +55,12 @@ fn generate_sst() -> (TempDir, SsTable) { #[test] fn test_sst_build_all() { - generate_sst(); + let (_, sst) = generate_sst(); + assert_eq!(sst.first_key().as_key_slice(), key_of(0).as_key_slice()); + assert_eq!( + sst.last_key().as_key_slice(), + key_of(num_of_keys() - 1).as_key_slice() + ) } #[test]