more tests on metadata check

feature/test_updates
Karolis Rusenas 2018-04-04 21:27:45 +01:00
parent d5ce30bb7a
commit 92220d6c5c
1 changed files with 20 additions and 0 deletions

View File

@ -203,6 +203,26 @@ func TestShouldUpdate(t *testing.T) {
want: false,
wantErr: false,
},
{
name: "parsed prerelease patch increase, policy minor, no prerelease",
args: args{
current: MustParse("v1.0.0"),
new: MustParse("v1.0.1-metadata"),
policy: types.PolicyTypeMinor,
},
want: false,
wantErr: false,
},
{
name: "parsed prerelease minor increase, policy minor, both have metadata",
args: args{
current: MustParse("v1.0.0-metadata"),
new: MustParse("v1.0.1-metadata"),
policy: types.PolicyTypeMinor,
},
want: true,
wantErr: false,
},
{
name: "prerelease patch increase, policy minor",
args: args{