@@ -273,45 +273,4 @@ mod tests {
273273 let result = conn. query ( "DELETE FROM test WHERE id > 1" ) . unwrap ( ) ;
274274 assert_eq ! ( result. row_count( ) , 2 ) ;
275275 }
276-
277- #[ derive( Debug , PartialEq ) ]
278- struct TestCacheEntry {
279- data : String ,
280- value : i32 ,
281- }
282-
283- #[ test]
284- fn test_object_cache_put_get ( ) {
285- let conn = test_connection ( ) . unwrap ( ) ;
286- let client_context = conn. client_context ( ) . unwrap ( ) ;
287- let cache = client_context. object_cache ( ) ;
288-
289- // Test with a simple struct
290- let test_entry = TestCacheEntry {
291- data : "hello world" . to_string ( ) ,
292- value : 42 ,
293- } ;
294-
295- // Store the entry in the cache
296- cache. put ( "test_key" , test_entry) ;
297-
298- // Retrieve it back
299- let retrieved = cache. get :: < TestCacheEntry > ( "test_key" ) ;
300- assert ! ( retrieved. is_some( ) ) ;
301-
302- let retrieved_entry = retrieved. unwrap ( ) ;
303- assert_eq ! ( retrieved_entry. data, "hello world" ) ;
304- assert_eq ! ( retrieved_entry. value, 42 ) ;
305- }
306-
307- #[ test]
308- fn test_object_cache_get_nonexistent ( ) {
309- let conn = test_connection ( ) . unwrap ( ) ;
310- let client_context = conn. client_context ( ) . unwrap ( ) ;
311- let cache = client_context. object_cache ( ) ;
312-
313- // Try to get a non-existent key
314- let result = cache. get :: < TestCacheEntry > ( "nonexistent_key" ) ;
315- assert ! ( result. is_none( ) ) ;
316- }
317276}
0 commit comments