(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestSetSplitterPolicy(t *testing.T) { |
| 13 | e := testenv.NewCLITest(t, testenv.RepoFormatNotImportant, testenv.NewInProcRunner(t)) |
| 14 | defer e.RunAndExpectSuccess(t, "repo", "disconnect") |
| 15 | |
| 16 | e.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", e.RepoDir) |
| 17 | |
| 18 | lines := e.RunAndExpectSuccess(t, "policy", "show", "--global") |
| 19 | lines = compressSpaces(lines) |
| 20 | require.Contains(t, lines, " Algorithm override: (repository default) (defined for this target)") |
| 21 | |
| 22 | // make some directory we'll be setting policy on |
| 23 | td := testutil.TempDirectory(t) |
| 24 | |
| 25 | lines = e.RunAndExpectSuccess(t, "policy", "show", td) |
| 26 | lines = compressSpaces(lines) |
| 27 | require.Contains(t, lines, " Algorithm override: (repository default) inherited from (global)") |
| 28 | |
| 29 | e.RunAndExpectSuccess(t, "policy", "set", td, "--splitter=FIXED-4M") |
| 30 | |
| 31 | lines = e.RunAndExpectSuccess(t, "policy", "show", td) |
| 32 | lines = compressSpaces(lines) |
| 33 | require.Contains(t, lines, " Algorithm override: FIXED-4M (defined for this target)") |
| 34 | |
| 35 | e.RunAndExpectSuccess(t, "policy", "set", td, "--splitter=inherit") |
| 36 | |
| 37 | lines = e.RunAndExpectSuccess(t, "policy", "show", td) |
| 38 | lines = compressSpaces(lines) |
| 39 | require.Contains(t, lines, " Algorithm override: (repository default) inherited from (global)") |
| 40 | |
| 41 | e.RunAndExpectFailure(t, "policy", "set", td, "--splitter=NO-SUCH_SPLITTER") |
| 42 | } |
nothing calls this directly
no test coverage detected