1 package osversion 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestOSVersionString(t *testing.T) { 9 v := OSVersion{ 10 Version: 809042555, 11 MajorVersion: 123, 12 MinorVersion: 2, 13 Build: 12345, 14 } 15 expected := "the version is: 123.2.12345" 16 actual := fmt.Sprintf("the version is: %s", v) 17 if actual != expected { 18 t.Errorf("expected: %q, got: %q", expected, actual) 19 } 20 } 21