mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
32 lines
644 B
Go
32 lines
644 B
Go
package useragent
|
|
|
|
import "testing"
|
|
|
|
func TestVersionInfo(t *testing.T) {
|
|
vi := VersionInfo{"foo", "bar"}
|
|
if !vi.isValid() {
|
|
t.Fatalf("VersionInfo should be valid")
|
|
}
|
|
vi = VersionInfo{"", "bar"}
|
|
if vi.isValid() {
|
|
t.Fatalf("Expected VersionInfo to be invalid")
|
|
}
|
|
vi = VersionInfo{"foo", ""}
|
|
if vi.isValid() {
|
|
t.Fatalf("Expected VersionInfo to be invalid")
|
|
}
|
|
}
|
|
|
|
func TestAppendVersions(t *testing.T) {
|
|
vis := []VersionInfo{
|
|
{"foo", "1.0"},
|
|
{"bar", "0.1"},
|
|
{"pi", "3.1.4"},
|
|
}
|
|
v := AppendVersions("base", vis...)
|
|
expect := "base foo/1.0 bar/0.1 pi/3.1.4"
|
|
if v != expect {
|
|
t.Fatalf("expected %q, got %q", expect, v)
|
|
}
|
|
}
|