setup-java/__tests__/util.test.ts
Maxim Lobanov 7c88894700
actions/setup-java@v2 - Support different distributions (#132)
* Implement support for custom vendors in setup-java

* minor improvements

* minor refactoring

* Add unit tests and e2e tests

* Update documentation for setup-java@v2 release

* minor improvements

* regenerate dist

* fix comments

* resolve comments

* resolve comments

* fix tests

* Update README.md

Co-authored-by: George Adams <george.adams@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* fix minor nitpicks

* handle 4th digit

* pull latest main

* Update README.md

* rename adoptium to adopt

* rename adoptium to adopt

* rename adoptium to adopt

* Update README.md

* make java-version and distribution required for action

* update readme

* fix tests

* fix e2e tests

Co-authored-by: George Adams <george.adams@microsoft.com>
Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
2021-03-15 13:39:46 +03:00

23 lines
748 B
TypeScript

import { isVersionSatisfies } from '../src/util';
describe('isVersionSatisfies', () => {
it.each([
['x', '11.0.0', true],
['3', '3.7.1', true],
['3', '3.7.2', true],
['3', '3.7.2+4', true],
['2.5', '2.5.0', true],
['2.5', '2.5.0+1', true],
['2.5', '2.6.1', false],
['2.5.1', '2.5.0', false],
['2.5.1+3', '2.5.0', false],
['2.5.1+3', '2.5.1+3', true],
['2.5.1+3', '2.5.1+2', false],
['15.0.0+14', '15.0.0+14.1.202003190635', false],
['15.0.0+14.1.202003190635', '15.0.0+14.1.202003190635', true]
])('%s, %s -> %s', (inputRange: string, inputVersion: string, expected: boolean) => {
const actual = isVersionSatisfies(inputRange, inputVersion);
expect(actual).toBe(expected);
});
});