mirror of
https://github.com/actions/setup-python.git
synced 2024-11-25 18:07:44 +00:00
35 lines
760 B
TypeScript
35 lines
760 B
TypeScript
|
import {
|
||
|
validateVersion,
|
||
|
validatePythonVersionFormatForPyPy
|
||
|
} from '../src/utils';
|
||
|
|
||
|
describe('validatePythonVersionFormatForPyPy', () => {
|
||
|
it.each([
|
||
|
['3.6', true],
|
||
|
['3.7', true],
|
||
|
['3.6.x', false],
|
||
|
['3.7.x', false],
|
||
|
['3.x', false],
|
||
|
['3', false]
|
||
|
])('%s -> %s', (input, expected) => {
|
||
|
expect(validatePythonVersionFormatForPyPy(input)).toEqual(expected);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
describe('validateVersion', () => {
|
||
|
it.each([
|
||
|
['v7.3.3', true],
|
||
|
['v7.3.x', true],
|
||
|
['v7.x', true],
|
||
|
['x', true],
|
||
|
['v7.3.3-rc.1', true],
|
||
|
['nightly', true],
|
||
|
['v7.3.b', false],
|
||
|
['3.6', true],
|
||
|
['3.b', false],
|
||
|
['3', true]
|
||
|
])('%s -> %s', (input, expected) => {
|
||
|
expect(validateVersion(input)).toEqual(expected);
|
||
|
});
|
||
|
});
|