rts-sim-module/modelrepo/check_test.go
walker c4bc8c640f 重构singleton组件及相关方法接口
调整repo目录结构和命名
初步开始重构仿真实体加载
2023-12-28 16:49:28 +08:00

24 lines
473 B
Go

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