headscale/hscontrol/capver/capver_test.go

30 lines
783 B
Go
Raw Normal View History

package capver
import (
"testing"
"github.com/google/go-cmp/cmp"
)
func TestTailscaleLatestMajorMinor(t *testing.T) {
2025-11-12 13:26:54 -06:00
for _, test := range tailscaleLatestMajorMinorTests {
t.Run("", func(t *testing.T) {
output := TailscaleLatestMajorMinor(test.n, test.stripV)
if diff := cmp.Diff(output, test.expected); diff != "" {
t.Errorf("TailscaleLatestMajorMinor(%d, %v) mismatch (-want +got):\n%s", test.n, test.stripV, diff)
}
})
}
}
func TestCapVerMinimumTailscaleVersion(t *testing.T) {
2025-11-12 13:26:54 -06:00
for _, test := range capVerMinimumTailscaleVersionTests {
t.Run("", func(t *testing.T) {
output := TailscaleVersion(test.input)
if output != test.expected {
t.Errorf("CapVerFromTailscaleVersion(%d) = %s; want %s", test.input, output, test.expected)
}
})
}
}