| 86 | } |
| 87 | |
| 88 | func TestZeroValue(t *testing.T) { |
| 89 | |
| 90 | testZeroValue := func(name string, got, want interface{}) { |
| 91 | t.Run(name, func(t *testing.T) { |
| 92 | if !reflect.DeepEqual(got, want) { |
| 93 | t.Errorf("zeroValue() = %v, want %v", got, want) |
| 94 | } |
| 95 | }) |
| 96 | } |
| 97 | |
| 98 | testZeroValue("int", zeroValue[int](), 0) |
| 99 | testZeroValue("float64", zeroValue[float64](), float64(0)) |
| 100 | testZeroValue("string", zeroValue[string](), "") |
| 101 | testZeroValue("bool", zeroValue[bool](), false) |
| 102 | |
| 103 | } |
| 104 | |
| 105 | func TestReceiveFromChannel(t *testing.T) { |
| 106 | // Since SendToChannel has already been tested, only buffered chan will be considered here |