MCPcopy
hub / github.com/perkeep/perkeep / TestCommandUsage

Function TestCommandUsage

cmd/pk-put/camput_test.go:97–110  ·  view source on GitHub ↗

TestCommandUsage tests that we output a command-specific usage message and return with a non-zero exit status.

(t *testing.T)

Source from the content-addressed store, hash-verified

95// TestCommandUsage tests that we output a command-specific usage message and return
96// with a non-zero exit status.
97func TestCommandUsage(t *testing.T) {
98 var e env
99 out, err, code := e.Run("attr")
100 if code != 1 {
101 t.Errorf("exit code = %d; want 1", code)
102 }
103 if len(out) != 0 {
104 t.Errorf("wanted nothing on stdout; got:\n%s", out)
105 }
106 sub := "Attr takes 3 args: <permanode> <attr> <value>"
107 if !bytes.Contains(err, []byte(sub)) {
108 t.Errorf("stderr doesn't contain substring %q. Got:\n%s", sub, err)
109 }
110}
111
112func TestUploadingChangingDirectory(t *testing.T) {
113 // TODO(bradfitz):

Callers

nothing calls this directly

Calls 2

RunMethod · 0.95
ContainsMethod · 0.80

Tested by

no test coverage detected