setup-python/__tests__/utils.test.ts
Dmitry Shibanov 8c5ea631b2
Adding support for more PyPy versions and installing them on-flight (#168)
* add support to install pypy

* resolved comments, update readme, add e2e tests.

* resolve throw error

* Add pypy unit tests to cover code

* add tests

* Update test-pypy.yml

* Update test-python.yml

* Update test-python.yml

* Update README.md

* fixing tests

* change order

Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>

* add pypy tests and fix issue with pypy-3-nightly

Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>
2020-12-17 16:03:54 +01:00

34 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);
});
});