Skip to content

Commit

Permalink
Properly set and restrict version-type strict across tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira committed Jul 13, 2024
1 parent e76dfc0 commit db89466
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/setup-beam.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,17 @@ async function testOTPVersions() {
expected = 'maint-26'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

before = simulateInput('version-type', 'strict')
spec = '27.0'
osVersion = 'ubuntu-24.04'
expected = 'OTP-27.0'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

before = simulateInput('version-type', 'strict')
spec = '25.3.2.1'
osVersion = 'ubuntu-20.04'
expected = 'OTP-25.3.2.1'
Expand Down Expand Up @@ -308,15 +310,17 @@ async function testLinuxARM64OTPVersions() {
expected = 'maint-26'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

before = simulateInput('version-type', 'strict')
spec = '27.0'
osVersion = 'ubuntu-24.04'
expected = 'OTP-27.0'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

before = simulateInput('version-type', 'strict')
spec = '25.3.2.1'
osVersion = 'ubuntu-20.04'
expected = 'OTP-25.3.2.1'
Expand Down Expand Up @@ -393,22 +397,24 @@ async function testLinuxAMD64OTPVersions() {
expected = 'maint-26'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

before = simulateInput('version-type', 'strict')
spec = '27.0'
osVersion = 'ubuntu-24.04'
expected = 'OTP-27.0'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

before = simulateInput('version-type', 'strict')
spec = '25.3.2.1'
osVersion = 'ubuntu-20.04'
expected = 'OTP-25.3.2.1'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)

simulateInput('version-type', before)

spec = '19.3.x'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6.13'
Expand Down Expand Up @@ -562,6 +568,7 @@ async function testElixirVersions() {
got = await setupBeam.getElixirVersion(spec, otpVersion)
assert.deepStrictEqual(got, expected)
simulateInput('version-type', before)

simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
}

Expand Down

0 comments on commit db89466

Please sign in to comment.