(t *testing.T)
| 587 | } |
| 588 | |
| 589 | func TestParseInt(t *testing.T) { |
| 590 | fieldMap := map[string]string{ |
| 591 | "ValidInt": "42", |
| 592 | "ZeroInt": "0", |
| 593 | "NegativeInt": "-10", |
| 594 | "InvalidInt": "not-a-number", |
| 595 | "EmptyString": "", |
| 596 | } |
| 597 | |
| 598 | assert.Equal(t, 42, parseInt(fieldMap, "ValidInt")) |
| 599 | assert.Equal(t, 0, parseInt(fieldMap, "ZeroInt")) |
| 600 | assert.Equal(t, -10, parseInt(fieldMap, "NegativeInt")) |
| 601 | assert.Equal(t, 0, parseInt(fieldMap, "InvalidInt")) |
| 602 | assert.Equal(t, 0, parseInt(fieldMap, "EmptyString")) |
| 603 | assert.Equal(t, 0, parseInt(fieldMap, "NonExistentField")) |
| 604 | } |
nothing calls this directly
no test coverage detected