File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,8 @@ pub extern "C" fn release_cache(cache: *mut cache_t) {
328328
329329#[ cfg( test) ]  
330330mod  tests { 
331+     use  crate :: assert_approx_eq; 
332+ 
331333    use  super :: * ; 
332334    use  std:: iter:: FromIterator ; 
333335    use  tempfile:: TempDir ; 
@@ -711,13 +713,10 @@ mod tests {
711713        assert_eq ! ( misses,  0 ) ; 
712714        assert_eq ! ( elements_pinned_memory_cache,  1 ) ; 
713715        assert_eq ! ( elements_memory_cache,  0 ) ; 
714-         let  expected = 5602873 ;  // +/- 20% 
715-         assert ! ( 
716-             size_pinned_memory_cache > expected *  80  / 100 , 
717-             "size_pinned_memory_cache: {size_pinned_memory_cache}" 
718-         ) ; 
719-         assert ! ( 
720-             size_pinned_memory_cache < expected *  120  / 100 , 
716+         assert_approx_eq ! ( 
717+             size_pinned_memory_cache, 
718+             5602873 , 
719+             "0.2" , 
721720            "size_pinned_memory_cache: {size_pinned_memory_cache}" 
722721        ) ; 
723722        assert_eq ! ( size_memory_cache,  0 ) ; 
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ macro_rules! assert_approx_eq {
2424} 
2525
2626#[ track_caller]  
27- fn  assert_approx_eq_impl < U :  Into < Uint128 > > ( 
27+ pub   fn  assert_approx_eq_impl < U :  Into < Uint128 > > ( 
2828    left :  U , 
2929    right :  U , 
3030    max_rel_diff :  & str , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments