Semaphore/services/tasks/http_test.go

33 lines
506 B
Go
Raw Permalink Normal View History

2021-10-12 21:43:15 +02:00
package tasks
import (
"testing"
)
func TestGetNextBuildVersion(t *testing.T) {
s := getNextBuildVersion("new-1.4-patch", "new-1.5-patch")
if s != "new-1.6-patch" {
t.Fatal()
}
s = getNextBuildVersion("new-1.4", "new-1.5")
if s != "new-1.6" {
t.Fatal()
}
s = getNextBuildVersion("1.4-patch", "1.5-patch")
if s != "1.6-patch" {
t.Fatal()
}
s = getNextBuildVersion("1.4.8", "1.4.9")
if s != "1.4.10" {
t.Fatal()
}
s = getNextBuildVersion("0", "7")
if s != "8" {
t.Fatal()
}
}