(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestToInt(t *testing.T) { |
| 158 | target := int(102) |
| 159 | if target != toInt(int8(102)) { |
| 160 | t.Errorf("Expected 102") |
| 161 | } |
| 162 | if target != toInt(int(102)) { |
| 163 | t.Errorf("Expected 102") |
| 164 | } |
| 165 | if target != toInt(int32(102)) { |
| 166 | t.Errorf("Expected 102") |
| 167 | } |
| 168 | if target != toInt(int16(102)) { |
| 169 | t.Errorf("Expected 102") |
| 170 | } |
| 171 | if target != toInt(int64(102)) { |
| 172 | t.Errorf("Expected 102") |
| 173 | } |
| 174 | if target != toInt("102") { |
| 175 | t.Errorf("Expected 102") |
| 176 | } |
| 177 | if 0 != toInt("frankie") { |
| 178 | t.Errorf("Expected 0") |
| 179 | } |
| 180 | if target != toInt(uint16(102)) { |
| 181 | t.Errorf("Expected 102") |
| 182 | } |
| 183 | if target != toInt(uint64(102)) { |
| 184 | t.Errorf("Expected 102") |
| 185 | } |
| 186 | if target != toInt(float64(102.1234)) { |
| 187 | t.Errorf("Expected 102") |
| 188 | } |
| 189 | if 1 != toInt(true) { |
| 190 | t.Errorf("Expected 102") |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | func TestToDecimal(t *testing.T) { |
| 195 | tests := map[interface{}]int64{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…