(t *testing.T)
| 16 | } |
| 17 | |
| 18 | func TestAnimalString(t *testing.T) { |
| 19 | x := Animal(109) |
| 20 | assert.Equal(t, "Animal(109)", x.String()) |
| 21 | x = Animal(1) |
| 22 | assert.Equal(t, "Dog", x.String()) |
| 23 | |
| 24 | y, err := ParseAnimal("Cat") |
| 25 | require.NoError(t, err, "Failed parsing cat") |
| 26 | assert.Equal(t, AnimalCat, y) |
| 27 | |
| 28 | z, err := ParseAnimal("Snake") |
| 29 | require.Error(t, err, "Shouldn't parse a snake") |
| 30 | assert.Equal(t, Animal(0), z) |
| 31 | } |
| 32 | |
| 33 | func TestAnimalUnmarshal(t *testing.T) { |
| 34 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…