MCPcopy Index your code
hub / github.com/perkeep/perkeep / TestMixedArrayFromString

Function TestMixedArrayFromString

pkg/schema/schema_test.go:119–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117}
118
119func TestMixedArrayFromString(t *testing.T) {
120 b80 := byte('\x80')
121 tests := []struct {
122 in string
123 want []interface{}
124 }{
125 {"foo", []interface{}{"foo"}},
126 {"\x80foo", []interface{}{b80, "foo"}},
127 {"foo\x80foo", []interface{}{"foo", b80, "foo"}},
128 {"foo\x80", []interface{}{"foo", b80}},
129 {"\x80", []interface{}{b80}},
130 {"\x80\x80", []interface{}{b80, b80}},
131 }
132 for _, tt := range tests {
133 got := mixedArrayFromString(tt.in)
134 if !reflect.DeepEqual(got, tt.want) {
135 t.Errorf("mixedArrayFromString(%q) = %#v; want %#v", tt.in, got, tt.want)
136 }
137 }
138}
139
140type mixPartsTest struct {
141 json, expected string

Callers

nothing calls this directly

Calls 1

mixedArrayFromStringFunction · 0.85

Tested by

no test coverage detected