(t *testing.T)
| 22 | ) |
| 23 | |
| 24 | func TestCanonizeExecutablePath(t *testing.T) { |
| 25 | var ( |
| 26 | canonized string |
| 27 | err error |
| 28 | ) |
| 29 | |
| 30 | canonized, err = CanonizeExecutablePath("foo", "/a/b", "", "") |
| 31 | require.Error(t, util.ErrBinaryNotFound, err) |
| 32 | |
| 33 | canonized, err = CanonizeExecutablePath("./foo", "/a/b", "", "") |
| 34 | require.Nil(t, err) |
| 35 | require.Equal(t, "/a/b/foo", canonized) |
| 36 | |
| 37 | canonized, err = CanonizeExecutablePath("../foo", "/a/b", "", "") |
| 38 | require.Nil(t, err) |
| 39 | require.Equal(t, "/a/foo", canonized) |
| 40 | |
| 41 | canonized, err = CanonizeExecutablePath("/foo", "/a/b", "", "") |
| 42 | require.Nil(t, err) |
| 43 | require.Equal(t, "/foo", canonized) |
| 44 | |
| 45 | canonized, err = CanonizeExecutablePath("~/foo", "/a/b", "", "") |
| 46 | require.Error(t, err) |
| 47 | |
| 48 | canonized, err = CanonizeExecutablePath("~/foo", "/a/b", "", "/home/user") |
| 49 | require.NoError(t, err) |
| 50 | require.Equal(t, "/home/user/foo", canonized) |
| 51 | } |
| 52 | |
| 53 | func TestIsCommandMatchingContext(t *testing.T) { |
| 54 | require.Equal(t, true, |
nothing calls this directly
no test coverage detected