gitee.com/quant1x/num@v0.3.2/builtin_test.go (about) 1 package num 2 3 import ( 4 "testing" 5 ) 6 7 func TestIsEmpty(t *testing.T) { 8 type args struct { 9 s string 10 } 11 tests := []struct { 12 name string 13 args args 14 want bool 15 }{ 16 { 17 name: "empty", 18 args: args{s: ""}, 19 want: true, 20 }, 21 { 22 name: "empty", 23 args: args{s: "\t"}, 24 want: true, 25 }, 26 { 27 name: "NaN", 28 args: args{s: StringNaN}, 29 want: false, 30 }, 31 { 32 name: "abc", 33 args: args{s: StringNaN}, 34 want: false, 35 }, 36 } 37 for _, tt := range tests { 38 t.Run(tt.name, func(t *testing.T) { 39 if got := IsEmpty(tt.args.s); got != tt.want { 40 t.Errorf("IsEmpty() = %v, want %v", got, tt.want) 41 } 42 }) 43 } 44 }