gitee.com/quant1x/num@v0.3.2/labs/testify_test.go (about) 1 package labs 2 3 import ( 4 "math" 5 "testing" 6 ) 7 8 func TestDeepEqual(t *testing.T) { 9 type args struct { 10 x any 11 y any 12 } 13 tests := []struct { 14 name string 15 args args 16 want bool 17 }{ 18 { 19 name: "nan", 20 args: args{ 21 x: math.NaN(), 22 y: math.NaN(), 23 }, 24 want: true, 25 }, 26 } 27 for _, tt := range tests { 28 t.Run(tt.name, func(t *testing.T) { 29 if got := DeepEqual(tt.args.x, tt.args.y); got != tt.want { 30 t.Errorf("DeepEqual() = %v, want %v", got, tt.want) 31 } 32 }) 33 } 34 }