Skip to content

Commit

Permalink
sanitize the paths added to / removed from cache
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Oct 27, 2023
1 parent 99af26d commit 67350aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ export def cache-manipulation [] {
[] | save-cache $CACHE
assert cache []

add-to-cache $CACHE "foo"
add-to-cache $CACHE ("foo" | path expand | path sanitize)
assert cache ["foo"]

add-to-cache $CACHE "bar"
add-to-cache $CACHE ("bar" | path expand | path sanitize)
assert cache ["bar", "foo"]

add-to-cache $CACHE "baz"
add-to-cache $CACHE ("baz" | path expand | path sanitize)
assert cache ["bar", "baz", "foo"]

remove-from-cache $CACHE "bar"
remove-from-cache $CACHE ("bar" | path expand | path sanitize)
assert cache ["baz", "foo"]

remove-from-cache $CACHE "brr"
remove-from-cache $CACHE ("brr" | path expand | path sanitize)
assert cache ["baz", "foo"]

rm --recursive --verbose --force $CACHE_DIR
Expand Down

0 comments on commit 67350aa

Please sign in to comment.