(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestForceUpperString(t *testing.T) { |
| 13 | tests := map[string]struct { |
| 14 | input string |
| 15 | output ForceUpperType |
| 16 | }{ |
| 17 | "dataswap": { |
| 18 | input: `DATASWAP`, |
| 19 | output: ForceUpperTypeDataSwap, |
| 20 | }, |
| 21 | "bootnode": { |
| 22 | input: `BOOTNODE`, |
| 23 | output: ForceUpperTypeBootNode, |
| 24 | }, |
| 25 | } |
| 26 | |
| 27 | for name, tc := range tests { |
| 28 | t.Run(name, func(t *testing.T) { |
| 29 | output, err := ParseForceUpperType(tc.input) |
| 30 | assert.NoError(t, err) |
| 31 | assert.Equal(t, tc.output, output) |
| 32 | |
| 33 | assert.Equal(t, tc.input, output.String()) |
| 34 | }) |
| 35 | } |
| 36 | |
| 37 | t.Run("failures", func(t *testing.T) { |
| 38 | assert.Equal(t, "ForceUpperType(99)", ForceUpperType(99).String()) |
| 39 | _, err := ParseForceUpperType("-1") |
| 40 | assert.Error(t, err) |
| 41 | }) |
| 42 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…