mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
83b5729f64
Signed-off-by: David Calavera <david.calavera@gmail.com>
17 lines
334 B
Go
17 lines
334 B
Go
package lib
|
|
|
|
import "testing"
|
|
|
|
func TestGetDockerOS(t *testing.T) {
|
|
cases := map[string]string{
|
|
"Docker/v1.22 (linux)": "linux",
|
|
"Docker/v1.22 (windows)": "windows",
|
|
"Foo/v1.22 (bar)": "",
|
|
}
|
|
for header, os := range cases {
|
|
g := getDockerOS(header)
|
|
if g != os {
|
|
t.Fatalf("Expected %s, got %s", os, g)
|
|
}
|
|
}
|
|
}
|