(t *testing.T)
| 971 | } |
| 972 | |
| 973 | func TestEncodeStructIncludeMap(t *testing.T) { |
| 974 | type U struct { |
| 975 | M map[string]string |
| 976 | } |
| 977 | type T struct { |
| 978 | A U |
| 979 | } |
| 980 | bytes, err := yaml.Marshal(T{ |
| 981 | A: U{ |
| 982 | M: map[string]string{"x": "y"}, |
| 983 | }, |
| 984 | }) |
| 985 | if err != nil { |
| 986 | t.Fatalf("%+v", err) |
| 987 | } |
| 988 | expect := "a:\n m:\n x: \"y\"\n" |
| 989 | actual := string(bytes) |
| 990 | if actual != expect { |
| 991 | t.Fatalf("unexpected output. expect:[%s] actual:[%s]", expect, actual) |
| 992 | } |
| 993 | } |
| 994 | |
| 995 | func TestEncodeDefinedTypeKeyMap(t *testing.T) { |
| 996 | type K string |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…