Skip to content

Commit

Permalink
Fix test_exercise.sh script (exercism#1815)
Browse files Browse the repository at this point in the history
The fuzzy matching of the path to the exercise slug would match
"pascals-triangle" before "triangle".
  • Loading branch information
senekor authored Nov 28, 2023
1 parent ff92b1c commit 7772c68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/test_exercise.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ cargo_args="$2"

# determine the exercise path from the slug
for p in exercises/{practice,concept}/* ; do
if [[ "$p" =~ $slug ]]; then
exercise_path=$p
current_slug="$(basename "$p")"
p="$(dirname "$p")"
if [[ "$current_slug" = "$slug" ]]; then
exercise_path="$p/$slug"
break
fi
done
Expand Down

0 comments on commit 7772c68

Please sign in to comment.