diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-01-29 22:34:05 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-01-30 15:47:34 +0300 |
commit | e47ed2a264364cace0519ee16f152fe882f2e6f8 (patch) | |
tree | df48b8f5427ea6031e6f08179b1cf876e44d10af /tests/standard-version/testscript | |
parent | 2be71ce80a4352a78ae80d0c698b07f0da765f99 (diff) |
Add support for $ in standard version constraint
Diffstat (limited to 'tests/standard-version/testscript')
-rw-r--r-- | tests/standard-version/testscript | 137 |
1 files changed, 131 insertions, 6 deletions
diff --git a/tests/standard-version/testscript b/tests/standard-version/testscript index cfe3b90..8a520a7 100644 --- a/tests/standard-version/testscript +++ b/tests/standard-version/testscript @@ -456,16 +456,141 @@ : 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 + $* <'-1.2.3' 2>'invalid constraint' == 1 : bad-char + $* <'~' 2>'no version' == 1 : no-version + $* <'~1.2' 2>"invalid version: '.' expected after minor version" == 1 : bad-ver + $* <'~1.999.0' 2>"invalid version: invalid minor version" == 1 : bad-min-tilde + $* <'^0.999.0' 2>"invalid version: invalid minor version" == 1 : bad-min-caret + $* <'^999.0.0' 2>"invalid version: invalid major version" == 1 : bad-maj-caret } } } +: constraints-dependent +: +{ + test.options += -cr + + : range + : + { + : valid + : + $* '1.2.3+1' <<EOI >>EOE + [1.2.2 $] + (1.2.2 $) + [$ 1.2.4] + ($ 1.2.4] + EOI + [1.2.2 1.2.3] + (1.2.2 1.2.3) + [1.2.3 1.2.4] + (1.2.3 1.2.4] + EOE + } + + : comparison + : + { + : valid + : + $* '1.2.3+1' <<EOI >>EOE + == $ + >= $ + <= $ + > $ + < $ + >= $ + <= $ + > $ + < $ + EOI + == 1.2.3 + >= 1.2.3 + <= 1.2.3 + > 1.2.3 + < 1.2.3 + >= 1.2.3 + <= 1.2.3 + > 1.2.3 + < 1.2.3 + EOE + + : invalid + : + { + $* '' <'== $' 2>'dependent version is empty' == 1 : empty-version + $* '1.2.3-' <'== $' 2>'dependent version is earliest' == 1 : earliest-version + $* '1.2.3-a.0.z' <'== $' 2>'invalid version: dependent version is latest snapshot' == 1 : latest-version + $* '0+1' <'== $' 2>'invalid version: dependent version is stub' == 1 : stub-version + } + } + + : shortcut + : + { + : final + : + { + $* '1.2.3+1' <<EOI >>EOE + ~$ + ^$ + EOI + ~1.2.0 + ^1.0.0 + EOE + } + + : pre-release + : + { + : tilda + : + { + $* '1.2.0-b.2' <'~$' >'~1.2.0-a.1' : no-final + $* '1.2.1-a.1' <'~$' >'~1.2.0' : final-patch + } + + : carrot + : + { + $* '1.0.0-b.2' <'^$' >'^1.0.0-a.1' : no-final + $* '1.0.1-a.1' <'^$' >'^1.0.0' : final-patch + $* '1.1.0-b.2' <'^$' >'^1.0.0' : final-minor + } + } + + : snapshot + : + { + : tilda + : + { + $* '1.2.1-a.2.345' <'~$' >'~1.2.0' : patch + $* '1.2.0-a.0.345' <'~$' >'[1.2.0-a.0.1 1.2.0-a.1)' : minor + $* '1.0.0-a.0.345' <'~$' >'[1.0.0-a.0.1 1.0.0-a.1)' : major + } + + : carrot + : + { + $* '1.2.1-a.2.345' <'^$' >'^1.0.0' : patch + $* '1.2.0-a.0.345' <'^$' >'[1.2.0-a.0.1 1.2.0-a.1)' : minor + $* '1.0.0-a.0.345' <'^$' >'[1.0.0-a.0.1 1.0.0-a.1)' : major + } + } + } + + : invalid + : + { + $* <'[1.2.2 $]' 2>'invalid max version: invalid major version' != 0 : max + $* <'[$ 1.2.2]' 2>'invalid min version: invalid major version' != 0 : min + $* <'== $' 2>'invalid version: invalid major version' != 0 : eq + $* <'~$' 2>'invalid version: invalid major version' != 0 : shortcut + } +} + : satisfaction : { |