(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestWithBasePath(t *testing.T) { |
| 38 | for _, tc := range []struct { |
| 39 | Name string |
| 40 | BasePath, Path []string |
| 41 | Error error |
| 42 | Bytes []byte |
| 43 | AssertPath func(*testing.T, ...string) bool |
| 44 | AssertError func(*testing.T, error) bool |
| 45 | AssertBytes func(*testing.T, []byte) bool |
| 46 | }{ |
| 47 | { |
| 48 | Name: "empty base path/empty path", |
| 49 | AssertPath: func(t *testing.T, pathElements ...string) bool { |
| 50 | return assertions.New(t).So(pathElements, should.BeEmpty) |
| 51 | }, |
| 52 | AssertError: func(t *testing.T, err error) bool { |
| 53 | return assertions.New(t).So(err, should.BeError) |
| 54 | }, |
| 55 | AssertBytes: func(t *testing.T, b []byte) bool { |
| 56 | return assertions.New(t).So(b, should.BeNil) |
| 57 | }, |
| 58 | }, |
| 59 | { |
| 60 | Name: "empty base path/path [foo bar baz]", |
| 61 | Path: []string{"foo", "bar", "baz"}, |
| 62 | Bytes: []byte{0x42, 0x41}, |
| 63 | AssertPath: func(t *testing.T, pathElements ...string) bool { |
| 64 | return assertions.New(t).So(pathElements, should.Resemble, []string{"foo", "bar", "baz"}) |
| 65 | }, |
| 66 | AssertError: func(t *testing.T, err error) bool { |
| 67 | return assertions.New(t).So(err, should.BeNil) |
| 68 | }, |
| 69 | AssertBytes: func(t *testing.T, b []byte) bool { |
| 70 | return assertions.New(t).So(b, should.Resemble, []byte{0x42, 0x41}) |
| 71 | }, |
| 72 | }, |
| 73 | { |
| 74 | Name: "empty base path/path [/foo bar baz]", |
| 75 | Path: []string{"/foo", "bar", "baz"}, |
| 76 | Bytes: []byte{0x42, 0x41}, |
| 77 | AssertPath: func(t *testing.T, pathElements ...string) bool { |
| 78 | return assertions.New(t).So(pathElements, should.Resemble, []string{"/foo", "bar", "baz"}) |
| 79 | }, |
| 80 | AssertError: func(t *testing.T, err error) bool { |
| 81 | return assertions.New(t).So(err, should.BeNil) |
| 82 | }, |
| 83 | AssertBytes: func(t *testing.T, b []byte) bool { |
| 84 | return assertions.New(t).So(b, should.Resemble, []byte{0x42, 0x41}) |
| 85 | }, |
| 86 | }, |
| 87 | { |
| 88 | Name: "base [foo bar baz]/empty path", |
| 89 | BasePath: []string{"foo", "bar", "baz"}, |
| 90 | AssertPath: func(t *testing.T, pathElements ...string) bool { |
| 91 | return assertions.New(t).So(pathElements, should.Resemble, []string{"foo", "bar", "baz"}) |
| 92 | }, |
| 93 | AssertError: func(t *testing.T, err error) bool { |
| 94 | return assertions.New(t).So(err, should.BeError) |
nothing calls this directly
no test coverage detected