diff --git a/sem-version b/sem-version index e853d1ca..75a4c1b8 100755 --- a/sem-version +++ b/sem-version @@ -68,7 +68,7 @@ version::change_elixir() { [[ "$software_version" == "1.12" ]] && software_version="1.12.3" [[ "$software_version" == "1.13" ]] && software_version="1.13.4" [[ "$software_version" == "1.14" ]] && software_version="1.14.5" - [[ "$software_version" == "1.15" ]] && software_version="1.15.2" + [[ "$software_version" == "1.15" ]] && software_version="1.15.7" if [[ $(kiex list) != *"${software_version}"* ]];then sem-install elixir "${software_version}" @@ -96,8 +96,8 @@ version::change_php() { [[ "$software_version" == "7.2" ]] && software_version="7.2.34" [[ "$software_version" == "7.3" ]] && software_version="7.3.33" [[ "$software_version" == "7.4" ]] && software_version="7.4.33" - [[ "$software_version" == "8" ]] && software_version="8.0.29" - [[ "$software_version" == "8.0" ]] && software_version="8.0.29" + [[ "$software_version" == "8" ]] && software_version="8.0.30" + [[ "$software_version" == "8.0" ]] && software_version="8.0.30" if ! [ -d ~/.phpbrew/php/php-"${software_version}" ]; then sem-install php "${software_version}" @@ -129,7 +129,7 @@ version::change_erlang() { [[ "$software_version" == "23" ]] && software_version="23.3" [[ "$software_version" == "24" ]] && software_version="24.3" [[ "$software_version" == "25" ]] && software_version="25.3" - [[ "$software_version" == "26" ]] && software_version="26.0" + [[ "$software_version" == "26" ]] && software_version="26.1" if [[ $(kerl list installations) != *"${software_version}"* ]]; then sem-install erlang "${software_version}" diff --git a/tests/sem_version_bionic/elixir.bats b/tests/sem_version_bionic/elixir.bats index 23c3dfad..5de843d5 100644 --- a/tests/sem_version_bionic/elixir.bats +++ b/tests/sem_version_bionic/elixir.bats @@ -54,8 +54,8 @@ setup() { assert_line --partial "Elixir 1.14.5" } -@test "change elixir to 1.15.2" { - sem-version elixir 1.15.2 +@test "change elixir to 1.15.7" { + sem-version elixir 1.15.7 run elixir --version - assert_line --partial "Elixir 1.15.2" + assert_line --partial "Elixir 1.15.7" } diff --git a/tests/sem_version_bionic/erlang.bats b/tests/sem_version_bionic/erlang.bats index ed9764d7..52c1b2a9 100644 --- a/tests/sem_version_bionic/erlang.bats +++ b/tests/sem_version_bionic/erlang.bats @@ -71,3 +71,9 @@ setup() { run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell assert_line --partial "26" } + +@test "change erlang to 26.1" { + sem-version erlang 26.1 + run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell + assert_line --partial "26" +} diff --git a/tests/sem_version_bionic/php.bats b/tests/sem_version_bionic/php.bats index 26a524b5..f138efed 100644 --- a/tests/sem_version_bionic/php.bats +++ b/tests/sem_version_bionic/php.bats @@ -63,32 +63,32 @@ setup() { assert_line --partial "imap" } -@test "change php to 8.0.29" { +@test "change php to 8.0.30" { - run sem-version php 8.0.29 + run sem-version php 8.0.30 assert_success source ~/.phpbrew/bashrc run php -v - assert_line --partial "PHP 8.0.29" + assert_line --partial "PHP 8.0.30" run php -m assert_line --partial "gd" assert_line --partial "imap" } -@test "php check composer 8.0.29" { +@test "php check composer 8.0.30" { run which composer assert_success source ~/.phpbrew/bashrc - assert_line --partial "8.0.29" + assert_line --partial "8.0.30" } -@test "php check source 8.0.29" { +@test "php check source 8.0.30" { - run sem-version php 8.0.29 + run sem-version php 8.0.30 assert_success source ~/.phpbrew/bashrc - assert_line --partial "8.0.29" + assert_line --partial "8.0.30" run phpbrew ext install iconv assert_success } diff --git a/tests/sem_version_focal/elixir.bats b/tests/sem_version_focal/elixir.bats index 522dc9e7..ff157315 100644 --- a/tests/sem_version_focal/elixir.bats +++ b/tests/sem_version_focal/elixir.bats @@ -61,8 +61,8 @@ setup() { assert_line --partial "Elixir 1.14.5" } -@test "change elixir to 1.15.2" { - sem-version elixir 1.15.2 +@test "change elixir to 1.15.7" { + sem-version elixir 1.15.7 run elixir --version - assert_line --partial "Elixir 1.15.2" + assert_line --partial "Elixir 1.15.7" } diff --git a/tests/sem_version_focal/node.bats b/tests/sem_version_focal/node.bats index f3da56b7..cec87b19 100644 --- a/tests/sem_version_focal/node.bats +++ b/tests/sem_version_focal/node.bats @@ -36,8 +36,8 @@ setup() { assert_line --partial "v16.15.1" } -@test "change node to 18.16.1" { - sem-version node 18.16.1 +@test "change node to 18.18.0" { + sem-version node 18.18.0 run node --version - assert_line --partial "v18.16.1" + assert_line --partial "v18.18.0" } diff --git a/tests/sem_version_focal/php.bats b/tests/sem_version_focal/php.bats index 8ffd1864..06ee4afe 100644 --- a/tests/sem_version_focal/php.bats +++ b/tests/sem_version_focal/php.bats @@ -39,47 +39,47 @@ setup() { assert_line --partial "imap" } -@test "change php to 8.0.29" { +@test "change php to 8.0.30" { - run sem-version php 8.0.29 + run sem-version php 8.0.30 assert_success source ~/.phpbrew/bashrc run php -v - assert_line --partial "PHP 8.0.29" + assert_line --partial "PHP 8.0.30" run php -m assert_line --partial "gd" assert_line --partial "imap" } -@test "php check composer 8.0.29" { +@test "php check composer 8.0.30" { run which composer assert_success source ~/.phpbrew/bashrc - assert_line --partial "8.0.29" + assert_line --partial "8.0.30" } -@test "php check 8.0.29" { +@test "php check 8.0.30" { - run sem-version php 8.0.29 + run sem-version php 8.0.30 assert_success source ~/.phpbrew/bashrc - assert_line --partial "8.0.29" + assert_line --partial "8.0.30" run phpbrew ext install iconv assert_success } -@test "php check sources 8.0.29" { +@test "php check sources 8.0.30" { - run sem-version php 8.0.29 + run sem-version php 8.0.30 assert_success source ~/.phpbrew/bashrc run ls -lah ~/.phpbrew/distfiles/ - assert_line --partial "8.0.29" + assert_line --partial "8.0.30" run ls -lah ~/.phpbrew/build/ - assert_line --partial "8.0.29" + assert_line --partial "8.0.30" run phpbrew ext install iconv assert_success diff --git a/tests/sem_version_focal/ruby.bats b/tests/sem_version_focal/ruby.bats new file mode 100644 index 00000000..711fa765 --- /dev/null +++ b/tests/sem_version_focal/ruby.bats @@ -0,0 +1,74 @@ +#!/usr/bin/env bats + +load "../support/bats-support/load" +load "../support/bats-assert/load" + +setup() { + source /tmp/.env-* + export PATH="/home/semaphore/.rbenv/bin:$PATH" + eval "$(rbenv init -)" + set -u + source ~/.toolbox/toolbox +} + +# Ruby +@test "change ruby to 2.7.8" { + + run sem-version ruby 2.7.8 + assert_success + run ruby --version + assert_line --partial "ruby 2.7.8" +} + +@test "change ruby to 3.0.6" { + + run sem-version ruby 3.0.6 + assert_success + run ruby --version + assert_line --partial "ruby 3.0.6" +} + +@test "change ruby to 3.1.4" { + + run sem-version ruby 3.1.4 + assert_success + run ruby --version + assert_line --partial "ruby 3.1.4" +} + +@test "change ruby to 3.2.2" { + + run sem-version ruby 3.2.2 + assert_success + run ruby --version + assert_line --partial "ruby 3.2.2" +} + +@test "ruby minor versions test" { + + run sem-version ruby 2.7 + assert_success + run ruby --version + assert_line --partial "ruby 2.7.8" + + run sem-version ruby 3.0 + assert_success + run ruby --version + assert_line --partial "ruby 3.0.6" + + run sem-version ruby 3.1 + assert_success + run ruby --version + assert_line --partial "ruby 3.1.4" + + run sem-version ruby 3.2 + assert_success + run ruby --version + assert_line --partial "ruby 3.2.2" +} + +@test "change ruby to 4.0.1" { + + run sem-version ruby 4.0.1 + assert_failure +} diff --git a/tests/sem_version_jammy_arm/elixir.bats b/tests/sem_version_jammy_arm/elixir.bats index 10165bed..00aeb649 100644 --- a/tests/sem_version_jammy_arm/elixir.bats +++ b/tests/sem_version_jammy_arm/elixir.bats @@ -41,8 +41,8 @@ setup() { assert_line --partial "Elixir 1.15.0" } -@test "change elixir to 1.15.2" { - sem-version elixir 1.15.2 +@test "change elixir to 1.15.7" { + sem-version elixir 1.15.7 run elixir --version - assert_line --partial "Elixir 1.15.2" + assert_line --partial "Elixir 1.15.7" } diff --git a/tests/sem_version_jammy_arm/erlang.bats b/tests/sem_version_jammy_arm/erlang.bats index 1c1bbe35..25f30d7f 100644 --- a/tests/sem_version_jammy_arm/erlang.bats +++ b/tests/sem_version_jammy_arm/erlang.bats @@ -58,3 +58,9 @@ setup() { run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell assert_line --partial "26" } + +@test "change erlang to 26.1" { + sem-version erlang 26.1 + run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell + assert_line --partial "26" +} diff --git a/tests/sem_version_jammy_arm/go.bats b/tests/sem_version_jammy_arm/go.bats index 63a27b6b..59369354 100644 --- a/tests/sem_version_jammy_arm/go.bats +++ b/tests/sem_version_jammy_arm/go.bats @@ -48,3 +48,12 @@ setup() { run go version assert_line --partial "go1.20.4" } + +@test "sem-version go 1.21.1" { + + sem-version go 1.21.1 + run echo ${PATH} + assert_line --partial "$(go env GOPATH)/bin" + run go version + assert_line --partial "go1.21.1" +} diff --git a/tests/sem_version_jammy_arm/java.bats b/tests/sem_version_jammy_arm/java.bats index 649fafc2..4207579d 100644 --- a/tests/sem_version_jammy_arm/java.bats +++ b/tests/sem_version_jammy_arm/java.bats @@ -22,6 +22,12 @@ setup() { source ~/.toolbox/toolbox } +@test "change java to 11" { + sem-version java 11 + run java --version + assert_line --partial "openjdk 11." +} + @test "change java to 17" { sem-version java 17 run java --version diff --git a/tests/sem_version_jammy_arm/node.bats b/tests/sem_version_jammy_arm/node.bats index a80bb6bc..46b8cfc7 100644 --- a/tests/sem_version_jammy_arm/node.bats +++ b/tests/sem_version_jammy_arm/node.bats @@ -41,8 +41,8 @@ setup() { assert_line --partial "v18.14.2" } -@test "change node to 18.16.1" { - sem-version node 18.16.1 +@test "change node to 18.18.0" { + sem-version node 18.18.0 run node --version - assert_line --partial "v18.16.1" + assert_line --partial "v18.18.0" } diff --git a/tests/sem_version_jammy_arm/php.bats b/tests/sem_version_jammy_arm/php.bats index 68478a33..943ab446 100644 --- a/tests/sem_version_jammy_arm/php.bats +++ b/tests/sem_version_jammy_arm/php.bats @@ -36,32 +36,32 @@ setup() { assert_line --partial "imap" } -@test "change php to 8.1.18" { +@test "change php to 8.1.23" { - run sem-version php 8.1.18 + run sem-version php 8.1.23 assert_success source ~/.phpbrew/bashrc run php -v - assert_line --partial "PHP 8.1.18" + assert_line --partial "PHP 8.1.23" run php -m assert_line --partial "gd" assert_line --partial "imap" } -@test "php check composer 8.1.18" { +@test "php check composer 8.1.23" { run which composer assert_success source ~/.phpbrew/bashrc - assert_line --partial "8.1.18" + assert_line --partial "8.1.23" } -@test "php check source 8.1.18" { +@test "php check source 8.1.23" { - run sem-version php 8.1.18 + run sem-version php 8.1.23 assert_success source ~/.phpbrew/bashrc - assert_line --partial "8.1.18" + assert_line --partial "8.1.23" run phpbrew ext install iconv assert_success } diff --git a/tests/sem_version_jammy_arm/ruby.bats b/tests/sem_version_jammy_arm/ruby.bats index 9991bf11..711fa765 100644 --- a/tests/sem_version_jammy_arm/ruby.bats +++ b/tests/sem_version_jammy_arm/ruby.bats @@ -36,12 +36,12 @@ setup() { assert_line --partial "ruby 3.1.4" } -@test "change ruby to 3.2.1" { +@test "change ruby to 3.2.2" { - run sem-version ruby 3.2.1 + run sem-version ruby 3.2.2 assert_success run ruby --version - assert_line --partial "ruby 3.2.1" + assert_line --partial "ruby 3.2.2" } @test "ruby minor versions test" { @@ -60,6 +60,11 @@ setup() { assert_success run ruby --version assert_line --partial "ruby 3.1.4" + + run sem-version ruby 3.2 + assert_success + run ruby --version + assert_line --partial "ruby 3.2.2" } @test "change ruby to 4.0.1" {