24 lines
468 B
Go
24 lines
468 B
Go
|
package repo
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestIsFieldEmpty(t *testing.T) {
|
||
|
tests := []struct {
|
||
|
give any
|
||
|
want bool
|
||
|
}{
|
||
|
{give: nil, want: true},
|
||
|
{give: "", want: true},
|
||
|
{give: 0, want: true},
|
||
|
{give: []string{}, want: true},
|
||
|
{give: map[string]string{}, want: true},
|
||
|
{give: []int{}, want: true},
|
||
|
}
|
||
|
|
||
|
for _, tt := range tests {
|
||
|
if got := isFieldEmpty(tt.give); got != tt.want {
|
||
|
t.Errorf("IsFieldEmpty(%v) = %v, want = %v", tt.give, got, tt.want)
|
||
|
}
|
||
|
}
|
||
|
}
|