diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-27 15:11:56 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-27 15:26:12 +0300 |
commit | dad361a3415e88475a78d1b2702133629fb6e548 (patch) | |
tree | 3d92aa7e87ca5a3dd3a1155f8317d677878182d2 /tests/standard-version/testscript | |
parent | 4b7dfd5a9c0e8f5aeacd14b2e629993550eef2b7 (diff) |
Add standard_version_constraint struct
Diffstat (limited to 'tests/standard-version/testscript')
-rw-r--r-- | tests/standard-version/testscript | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/standard-version/testscript b/tests/standard-version/testscript index 335bed9..9c80ddb 100644 --- a/tests/standard-version/testscript +++ b/tests/standard-version/testscript @@ -188,3 +188,86 @@ $* '1.2.3-a.1.2.xy' '1.2.3-a.1.2' >'0' : ignore-snapshot-id } } + +: constraints +: +{ + test.options += -r + + : range + : + { + : valid + : + $* <<EOI >>EOE + [1.2.3 1.2.4] + (1.2.3 1.2.4) + [ 1.2.3 1.2.4 ] + EOI + [1.2.3 1.2.4] + (1.2.3 1.2.4) + [1.2.3 1.2.4] + EOE + + : invalid + : + { + $* <'' 2>'invalid constraint' == 1 : empty + $* <'1' 2>'invalid constraint' == 1 : no-opening + $* <'[ ' 2>'no min version' == 1 : no-min + $* <'[1.2.3' 2>'no max version' == 1 : no-max + $* <'[1.2.3 1.2.4' 2>'no closing bracket' == 1 : no-closing + $* <'[1.2.3 1.2.4)]' 2>'junk after constraint' == 1 : junk + + : invalid-min + : + $* <'[1' 2>"invalid min version: '.' expected after major version" == 1 + + : invalid-max + : + $* <'[1.2.3 1' 2>"invalid max version: '.' expected after major version" == 1 + + : min-gt-max + : + $* <'[1.2.4 1.2.3]' 2>'min version is greater than max version' == 1 + + : open-end + : + $* <'[1.2.3 1.2.3)' 2>'equal version endpoints not closed' == 1 + } + } + + : comparison + : + { + : valid + : + $* <<EOI >>EOE + == 1.2.3 + >= 1.2.3 + <= 1.2.3 + > 1.2.3 + < 1.2.3 + <=1.2.3 + <1.2.3 + EOI + == 1.2.3 + >= 1.2.3 + <= 1.2.3 + > 1.2.3 + < 1.2.3 + <= 1.2.3 + < 1.2.3 + EOE + + : invalid + : + { + $* <'>=' 2>'no version' == 1 : no-version + + : junk + : + $* <'>= 1.2.3-a.1.1.ads@' 2>'invalid version: junk after version' == 1 + } + } +} |