Skip to content

Commit 2c0fafe

Browse files
glyhdannywillems
authored andcommitted
Disk Cache Test Lib : Simplify remove_data_on_gc
1 parent 3482f85 commit 2c0fafe

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/lib/disk_cache/test_lib/disk_cache_test_lib.ml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,12 @@ module Make_impl (Cache : Disk_cache_intf.S_with_count with module Data := Mock)
9595
[%test_eq: string] proof.proof proof_from_cache.proof
9696
~message:"invalid proof from cache" ) ;
9797

98-
match gc_strict with
99-
| Some false ->
100-
()
101-
| _ ->
102-
Gc.compact () ;
103-
[%test_eq: int] (Cache.count cache) 0
104-
~message:"cache should be empty after garbage collector run"
105-
106-
let remove_data_on_gc ?gc_strict () =
98+
if gc_strict then (
99+
Gc.compact () ;
100+
[%test_eq: int] (Cache.count cache) 0
101+
~message:"cache should be empty after garbage collector run" )
102+
103+
let remove_data_on_gc ?(gc_strict = true) () =
107104
Async.Thread_safe.block_on_async_exn
108105
@@ fun () ->
109106
File_system.with_temp_dir "disk_cache-remove_data_on_gc"

0 commit comments

Comments
 (0)