代码拉取完成,页面将自动刷新
package gocsv
import "testing"
func Test_fieldInfo_matchesKey(t *testing.T) {
type fields struct {
keys []string
omitEmpty bool
IndexChain []int
defaultValue string
partial bool
}
type args struct {
key string
}
tests := []struct {
name string
fields fields
args args
want bool
}{
{
name: "valid value",
fields: fields{
keys: []string{"date"},
},
args: args{"date"},
want: true,
},
{
name: "zero width space (U+200B)",
fields: fields{
keys: []string{"date"},
},
args: args{"\u200Bdate"},
want: true,
},
{
name: "zero width non-joiner (U+200C)",
fields: fields{
keys: []string{"date"},
},
args: args{"\u200Cdate"},
want: true,
},
{
name: "zero width joiner (U+200D)",
fields: fields{
keys: []string{"date"},
},
args: args{"\u200Ddate"},
want: true,
},
{
name: "zero width no-break space (U+FEFF)",
fields: fields{
keys: []string{"date"},
},
args: args{"\uFEFFdate"},
want: true,
},
{
name: "zero width no-break space (U+FEFF) in the middle of the string",
fields: fields{
keys: []string{"date"},
},
args: args{"da\uFEFFte"},
want: true,
},
{
name: "zero width no-break space (U+FEFF) in the end of the string",
fields: fields{
keys: []string{"date"},
},
args: args{"date\uFEFF"},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
f := fieldInfo{
keys: tt.fields.keys,
omitEmpty: tt.fields.omitEmpty,
IndexChain: tt.fields.IndexChain,
defaultValue: tt.fields.defaultValue,
partial: tt.fields.partial,
}
if got := f.matchesKey(tt.args.key); got != tt.want {
t.Errorf("matchesKey() = %v, want %v", got, tt.want)
}
})
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。