mirror of
https://gitea.com/actions/setup-java.git
synced 2025-04-05 14:59:37 +00:00
Corretto toolcache folder name fix (#480)
This commit is contained in:
@ -227,22 +227,3 @@ describe('findPackageForDownload', () => {
|
||||
).rejects.toThrow(/Could not find satisfied version for semver */);
|
||||
});
|
||||
});
|
||||
|
||||
describe('convertVersionToSemver', () => {
|
||||
it.each([
|
||||
[[12], '12'],
|
||||
[[12, 0], '12.0'],
|
||||
[[12, 0, 2], '12.0.2'],
|
||||
[[12, 0, 2, 1], '12.0.2+1'],
|
||||
[[12, 0, 2, 1, 3], '12.0.2+1']
|
||||
])('%s -> %s', (input: number[], expected: string) => {
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '18',
|
||||
architecture: 'x86',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
const actual = distribution['convertVersionToSemver'](input);
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,10 @@
|
||||
import * as cache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import {isVersionSatisfies, isCacheFeatureAvailable} from '../src/util';
|
||||
import {
|
||||
convertVersionToSemver,
|
||||
isVersionSatisfies,
|
||||
isCacheFeatureAvailable
|
||||
} from '../src/util';
|
||||
|
||||
jest.mock('@actions/cache');
|
||||
jest.mock('@actions/core');
|
||||
@ -63,3 +67,16 @@ describe('isCacheFeatureAvailable', () => {
|
||||
expect(isCacheFeatureAvailable()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('convertVersionToSemver', () => {
|
||||
it.each([
|
||||
['12', '12'],
|
||||
['12.0', '12.0'],
|
||||
['12.0.2', '12.0.2'],
|
||||
['12.0.2.1', '12.0.2+1'],
|
||||
['12.0.2.1.0', '12.0.2+1.0']
|
||||
])('%s -> %s', (input: string, expected: string) => {
|
||||
const actual = convertVersionToSemver(input);
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user