From 78b45d33dfa96e3875b53d55dfa4451dda84313f Mon Sep 17 00:00:00 2001 From: Mary McGrath Date: Fri, 30 Aug 2024 16:21:18 -0400 Subject: [PATCH] fix: don't let safe names end with a `-` (#90) --- src/testrel.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/testrel.jl b/src/testrel.jl index 5d9ddd4..282b6ae 100644 --- a/src/testrel.jl +++ b/src/testrel.jl @@ -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