mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-24 22:06:43 +01:00
33 lines
506 B
Go
33 lines
506 B
Go
|
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()
|
||
|
}
|
||
|
}
|