1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 06:13:53 -05:00

💅 Clean up version sorting and add test

This commit is contained in:
Mislav Marohnić
2021-05-06 13:25:06 +02:00
parent d3d4606d2f
commit 28cd6f123e
3 changed files with 39 additions and 50 deletions

View File

@@ -119,7 +119,7 @@ path_without() {
if [ "$found" != "${RBENV_ROOT}/shims" ]; then
alt="${RBENV_TEST_DIR}/$(echo "${found#/}" | tr '/' '-')"
mkdir -p "$alt"
for util in bash head cut readlink greadlink; do
for util in bash head cut readlink greadlink sed sort awk; do
if [ -x "${found}/$util" ]; then
ln -s "${found}/$util" "${alt}/$util"
fi

View File

@@ -56,15 +56,19 @@ OUT
@test "multiple versions" {
stub_system_ruby
create_version "1.8.7"
create_version "1.9.3"
create_version "1.9.3-p13"
create_version "1.9.3-p2"
create_version "2.2.10"
create_version "2.2.3"
create_version "2.2.3-pre.2"
run rbenv-versions
assert_success
assert_output <<OUT
* system
1.8.7
1.9.3
1.9.3-p2
1.9.3-p13
2.2.3-pre.2
2.2.3
2.2.10
OUT