File tree Expand file tree Collapse file tree
quickwit/quickwit-search/src/list_fields Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,3 +38,24 @@ impl ListFieldsCache {
3838 self . cache . put ( split_id, serialized_split_fields) ;
3939 }
4040}
41+
42+ #[ cfg( test) ]
43+ mod tests {
44+ use bytesize:: ByteSize ;
45+
46+ use super :: * ;
47+
48+ #[ test]
49+ fn list_fields_cache_get_miss_returns_none ( ) {
50+ let cache = ListFieldsCache :: new ( & CacheConfig :: default_with_capacity ( ByteSize :: mb ( 1 ) ) ) ;
51+ assert ! ( cache. get( & "missing" . to_string( ) ) . is_none( ) ) ;
52+ }
53+
54+ #[ test]
55+ fn list_fields_cache_put_then_get_roundtrips ( ) {
56+ let cache = ListFieldsCache :: new ( & CacheConfig :: default_with_capacity ( ByteSize :: mb ( 1 ) ) ) ;
57+ let payload = OwnedBytes :: new ( b"hello" . to_vec ( ) ) ;
58+ cache. put ( "split-1" . to_string ( ) , payload. clone ( ) ) ;
59+ assert_eq ! ( cache. get( & "split-1" . to_string( ) ) , Some ( payload) ) ;
60+ }
61+ }
Original file line number Diff line number Diff line change @@ -204,5 +204,5 @@ async fn merge_fields_metadata(
204204 } )
205205 } )
206206 . await
207- . context ( "failed to merge single split list fields" ) ?
207+ . context ( "failed to merge leaf list fields responses " ) ?
208208}
You can’t perform that action at this time.
0 commit comments