(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestInterfaceToInt(t *testing.T) { |
| 99 | var out int |
| 100 | var ok bool |
| 101 | |
| 102 | out, ok = InterfaceToInt(int(1)) |
| 103 | require.True(t, ok) |
| 104 | require.Equal(t, int(1), out) |
| 105 | |
| 106 | _, ok = InterfaceToInt(float32(2)) |
| 107 | require.False(t, ok) |
| 108 | |
| 109 | _, ok = InterfaceToInt("test") |
| 110 | require.False(t, ok) |
| 111 | } |
| 112 | |
| 113 | func TestInterfaceToInt8Downcast(t *testing.T) { |
| 114 | var out int8 |
nothing calls this directly
no test coverage detected