diff --git a/src/model/image-tag.test.ts b/src/model/image-tag.test.ts index 56283fa..806dec4 100644 --- a/src/model/image-tag.test.ts +++ b/src/model/image-tag.test.ts @@ -8,9 +8,13 @@ describe('ImageTag', () => { expect(() => new ImageTag(unityVersion)).not.toThrow(); }); - test.each(['2000.0.0f0', '2011.1.11f1'])('accepts %p version format', (version) => { + test.each(['2000.0.0f0', '2011.1.11f1', '6000.0.0f0'])('accepts %p version format', (version) => { expect(() => new ImageTag(version)).not.toThrow(); }); + + test.each(['1999.1.1f1', '6000.1.invalid'])('rejects %p version format', (version) => { + expect(() => new ImageTag(version)).toThrow(`Invalid version "${version}".`); + }); }); describe('toString', () => { it('returns the correct version', () => { diff --git a/src/model/image-tag.ts b/src/model/image-tag.ts index 2fe8fdf..fd92a06 100644 --- a/src/model/image-tag.ts +++ b/src/model/image-tag.ts @@ -27,7 +27,7 @@ class ImageTag { } static get versionPattern() { - return /^20\d{2}\.\d\.\w{3,4}|3$/; + return /^(20\d{2}\.\d\.\w{3,4}|6000\.\d\.\w{3,4})$/; } static get imageSuffixes() {