Skip to content

Commit

Permalink
fix: don't let safe names end with a - (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcgrath13 authored Aug 30, 2024
1 parent 2c565c7 commit 78b45d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/testrel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ using UUIDs
# is not guaranteed
function gen_safe_name(basename)
name = "$(basename)-$(UUIDs.uuid4(MersenneTwister()))"
return name[1:min(sizeof(name), 63)]
name = name[1:min(sizeof(name), 63)]
if last(name) == '-'
name = name[1:(end - 1)]
end
return name
end

mutable struct TestDefaults
Expand Down

0 comments on commit 78b45d3

Please sign in to comment.