mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-28 23:14:25 +09:00
Some checks failed
Build / build-nix (push) Has been cancelled
Build / build-cross (GOARCH=amd64 GOOS=darwin) (push) Has been cancelled
Build / build-cross (GOARCH=amd64 GOOS=linux) (push) Has been cancelled
Build / build-cross (GOARCH=arm64 GOOS=darwin) (push) Has been cancelled
Build / build-cross (GOARCH=arm64 GOOS=linux) (push) Has been cancelled
Check Generated Files / check-generated (push) Has been cancelled
NixOS Module Tests / nix-module-check (push) Has been cancelled
Tests / test (push) Has been cancelled
30 lines
783 B
Go
30 lines
783 B
Go
package capver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/google/go-cmp/cmp"
|
|
)
|
|
|
|
func TestTailscaleLatestMajorMinor(t *testing.T) {
|
|
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) {
|
|
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)
|
|
}
|
|
})
|
|
}
|
|
}
|