Skip to content

Commit

Permalink
fix: make cleanup command work again
Browse files Browse the repository at this point in the history
  • Loading branch information
eWert-Online committed Apr 19, 2024
1 parent 8fdfbf1 commit 2e35c0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/OSnap_Cleanup.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let cleanup ~config_path =
|> List.filter_map (fun (size : Config.Types.size) ->
let Config.Types.{ width; height; _ } = size in
let filename = OSnap_Test.get_filename test.name width height in
let current_image_path = snapshot_dir ^ filename in
let current_image_path = Filename.concat snapshot_dir filename in
let exists = Sys.file_exists current_image_path in
if exists then Some filename else None))
|> List.flatten
Expand All @@ -23,7 +23,7 @@ let cleanup ~config_path =
Sys.readdir snapshot_dir
|> Array.to_list
|> List.filter_map (fun file ->
if List.mem file test_file_paths
if not (List.mem file test_file_paths)
then Some (Filename.concat snapshot_dir file)
else None)
in
Expand Down
4 changes: 2 additions & 2 deletions lib/OSnap_Test/OSnap_Test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ let get_ignore_regions ~document target size_name regions =

let get_filename ?(diff = false) name width height =
if diff
then Printf.sprintf "/diff_%s_%ix%i.png" name width height
else Printf.sprintf "/%s_%ix%i.png" name width height
then Printf.sprintf "diff_%s_%ix%i.png" name width height
else Printf.sprintf "%s_%ix%i.png" name width height
;;

let run (global_config : Config.Types.global) target test =
Expand Down

0 comments on commit 2e35c0c

Please sign in to comment.