debian-forge-composer/internal/store/store_test.go
Lars Karlitski 94bfcc518c weldr: bump blueprint version
According to the same rules as lorax-compposer:

  https://weldr.io/lorax/lorax-composer.html#blueprints
2019-12-04 18:35:18 +01:00

30 lines
556 B
Go

package store
import (
"testing"
)
func TestBumpVersion(t *testing.T) {
cases := []struct {
Version string
Expected string
}{
{"", ""},
{"0", "0.0.1"},
{"0.0", "0.0.1"},
{"0.0.0", "0.0.1"},
{"2.1.3", "2.1.4"},
// don't touch invalid version strings
{"0.0.0.0", "0.0.0.0"},
{"0.a.0", "0.a.0"},
{"foo", "foo"},
}
for _, c := range cases {
result := bumpVersion(c.Version)
if result != c.Expected {
t.Errorf("bumpVersion(%#v) is expected to return %#v, but instead returned %#v", c.Version, c.Expected, result)
}
}
}