(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestGetDockerPortMapping(t *testing.T) { |
| 14 | for _, tcase := range []struct { |
| 15 | out string |
| 16 | expectedPort int |
| 17 | expectedErr error |
| 18 | }{ |
| 19 | {out: "0.0.0.0:2313", expectedPort: 2313}, |
| 20 | {out: "error", expectedErr: errors.New("got unexpected output: error")}, |
| 21 | {out: ` 0.0.0.0:49154 |
| 22 | :::49154`, expectedPort: 49154}, |
| 23 | } { |
| 24 | t.Run("", func(t *testing.T) { |
| 25 | l, err := getDockerPortMapping([]byte(tcase.out)) |
| 26 | if tcase.expectedErr != nil { |
| 27 | testutil.NotOk(t, err) |
| 28 | testutil.Equals(t, tcase.expectedErr.Error(), err.Error()) |
| 29 | return |
| 30 | } |
| 31 | testutil.Ok(t, err) |
| 32 | testutil.Equals(t, tcase.expectedPort, l) |
| 33 | }) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestValidateName(t *testing.T) { |
| 38 | for _, tcase := range []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…