rts-sim-module/repo/check_test.go
2023-12-27 09:15:26 +08:00

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)
}
}
}