mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 02:56:54 +08:00
Add tests for range input
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import * as installer from '../src/installer'
|
import * as installer from '../src/installer'
|
||||||
|
|
||||||
|
const testVersions = ['v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0']
|
||||||
|
|
||||||
describe('installer tests', () => {
|
describe('installer tests', () => {
|
||||||
describe('version matching', () => {
|
describe('version matching', () => {
|
||||||
describe('specific versions', () => {
|
describe('specific versions', () => {
|
||||||
@@ -13,5 +15,13 @@ describe('installer tests', () => {
|
|||||||
expect(await installer.getJuliaVersion([], '1.3.0-rc2')).toEqual('1.3.0-rc2')
|
expect(await installer.getJuliaVersion([], '1.3.0-rc2')).toEqual('1.3.0-rc2')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
describe('version ranges', () => {
|
||||||
|
it('Chooses the highest available version that matches the input', async () => {
|
||||||
|
expect(await installer.getJuliaVersion(testVersions, '1')).toEqual('1.2.0')
|
||||||
|
expect(await installer.getJuliaVersion(testVersions, '1.0')).toEqual('1.0.5')
|
||||||
|
expect(await installer.getJuliaVersion(testVersions, '^1.3.0-rc1')).toEqual('1.3.0-rc4')
|
||||||
|
expect(await installer.getJuliaVersion(testVersions, '^1.2.0-rc1')).toEqual('1.2.0')
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user