(t *testing.T, tarfile string, optionsCheck CheckOptions, optionsPrune PruneOptions, checkOK, pruneOK bool)
| 215 | } |
| 216 | |
| 217 | func testEdgeCaseRepo(t *testing.T, tarfile string, optionsCheck CheckOptions, optionsPrune PruneOptions, checkOK, pruneOK bool) { |
| 218 | env, cleanup := withTestEnvironment(t) |
| 219 | defer cleanup() |
| 220 | |
| 221 | datafile := filepath.Join("testdata", tarfile) |
| 222 | rtest.SetupTarTestFixture(t, env.base, datafile) |
| 223 | |
| 224 | if checkOK { |
| 225 | testRunCheck(t, env.gopts) |
| 226 | } else { |
| 227 | rtest.Assert(t, withTermStatus(t, env.gopts, func(ctx context.Context, gopts global.Options) error { |
| 228 | _, err := runCheck(context.TODO(), optionsCheck, gopts, nil, gopts.Term) |
| 229 | return err |
| 230 | }) != nil, |
| 231 | "check should have reported an error") |
| 232 | } |
| 233 | |
| 234 | if pruneOK { |
| 235 | testRunPrune(t, env.gopts, optionsPrune) |
| 236 | testRunCheck(t, env.gopts) |
| 237 | } else { |
| 238 | rtest.Assert(t, withTermStatus(t, env.gopts, func(ctx context.Context, gopts global.Options) error { |
| 239 | return runPrune(context.TODO(), optionsPrune, gopts, gopts.Term) |
| 240 | }) != nil, |
| 241 | "prune should have reported an error") |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | func TestPruneRepackSmallerThanSmoke(t *testing.T) { |
| 246 | env, cleanup := withTestEnvironment(t) |
no test coverage detected