diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-04 23:42:51 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-05 16:02:10 +0300 |
commit | 166c3167bc608a63e2312930a9b722f8d697d2c5 (patch) | |
tree | 086b2b42f34414b45919ea1a7bf42ffb18f887d8 /tests/standard-version/testscript | |
parent | b5b66e6a831cf68b7da764235f669fad758491fb (diff) |
Add support for standard version constraint shortcut operators
Diffstat (limited to 'tests/standard-version/testscript')
-rw-r--r-- | tests/standard-version/testscript | 93 |
1 files changed, 92 insertions, 1 deletions
diff --git a/tests/standard-version/testscript b/tests/standard-version/testscript index f06b178..65c446b 100644 --- a/tests/standard-version/testscript +++ b/tests/standard-version/testscript @@ -66,6 +66,14 @@ $* <<EOF >>EOF EOF + + : max + : + $* <<EOF >>EOF + 1.2.999 + 1.999.999 + 999.999.999 + EOF } : invalid @@ -236,10 +244,12 @@ [1.2.3 1.2.4] (1.2.3 1.2.4) [ 1.2.3- 1.2.4- ] + [1.999.0 2.0.0) EOI [1.2.3 1.2.4] (1.2.3 1.2.4) [1.2.3- 1.2.4-] + [1.999.0 2.0.0) EOE : invalid @@ -262,7 +272,7 @@ : min-gt-max : - $* <'[1.2.4 1.2.3]' 2>'min version is greater than max version' == 1 + $* <'[999.0.0 1.0.0)' 2>'min version is greater than max version' == 1 : open-end : @@ -319,6 +329,53 @@ $* <'>= 1.2.3-a.1.1.ads@' 2>'invalid version: junk after version' == 1 } } + + : shortcut + : + { + : valid + : + $* <<EOI >>EOO + ~1.2.3 + ^1.2.3 + ^0.2.3 + ~1.2.3- + ^1.2.3- + ^0.2.3- + ~1.2.3-a.1 + ^1.2.3-a.1 + ^0.2.3-a.1 + ~1.2.3-a.1.123 + ^1.2.3-a.1.123 + ^0.2.3-a.1.123 + ~ 1.2.3 + EOI + ~1.2.3 + ^1.2.3 + ^0.2.3 + ~1.2.3- + ^1.2.3- + ^0.2.3- + ~1.2.3-a.1 + ^1.2.3-a.1 + ^0.2.3-a.1 + ~1.2.3-a.1.123 + ^1.2.3-a.1.123 + ^0.2.3-a.1.123 + ~1.2.3 + EOO + + : invalid + : + { + $* <'-1.2.3' 2>'invalid constraint' == 1 : bad-char + $* <'~' 2>'no version' == 1 : no-version + $* <'~1.2' 2>"'.' expected after minor version" == 1 : bad-ver + $* <'~1.999.0' 2>"invalid minor version" == 1 : bad-min-tilde + $* <'^0.999.0' 2>"invalid minor version" == 1 : bad-min-caret + $* <'^999.0.0' 2>"invalid major version" == 1 : bad-maj-caret + } + } } : satisfaction @@ -401,4 +458,38 @@ $* '1.2.3' '[1.2.1 1.2.2)' >n : open } } + + : shortcut + : + { + : tilde + : + { + $* '1.2.3-b.499' '~1.2.3' >n : out-left + $* '1.2.3' '~1.2.3' >y : in-left + $* '1.2.4' '~1.2.3' >y : in + $* '1.2.999' '~1.2.3' >y : in-right + $* '1.3.0-' '~1.2.3' >n : out-right + } + + : caret + : + { + $* '1.2.3-b.499' '^1.2.3' >n : out-left + $* '1.2.3' '^1.2.3' >y : in-left + $* '1.3.0' '^1.2.3' >y : in + $* '1.999.999' '^1.2.3' >y : in-right + $* '2.0.0-' '^1.2.3' >n : out-right + } + + : caret-zero-major + : + { + $* '0.2.3-b.499' '^0.2.3' >n : out-left + $* '0.2.3' '^0.2.3' >y : in-left + $* '0.2.4' '^0.2.3' >y : in + $* '0.2.999' '^0.2.3' >y : in-right + $* '0.3.0-' '^0.2.3' >n : out-right + } + } } |