MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestRemoveCmd_Execute_ValidationBeforeInit

Function TestRemoveCmd_Execute_ValidationBeforeInit

cmds/cmd_remove_test.go:280–296  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

278}
279
280func TestRemoveCmd_Execute_ValidationBeforeInit(t *testing.T) {
281 // Cleanup.
282 dirs.RemoveAllForTest()
283
284 remove := &removeCmd{
285 celer: nil, // Should not be touched for invalid input.
286 }
287
288 err := remove.execute([]string{"invalid-package"})
289 if err == nil {
290 t.Fatal("expected validation error")
291 }
292
293 if !strings.Contains(err.Error(), "invalid package names") {
294 t.Fatalf("expected validation-first error, got: %v", err)
295 }
296}
297
298func TestRemoveCmd_GetInstalledPackages(t *testing.T) {
299 // Cleanup.

Callers

nothing calls this directly

Calls 3

executeMethod · 0.95
RemoveAllForTestFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected