(t *testing.T)
| 86 | t.Setenv("XDG_CONFIG_HOME", tmpDir) |
| 87 | t.Setenv("XDG_STATE_HOME", tmpDir) |
| 88 | t.Setenv("XDG_CACHE_HOME", tmpDir) |
| 89 | |
| 90 | root := newRootCmd() |
| 91 | var buf bytes.Buffer |
| 92 | root.SetOut(&buf) |
| 93 | root.SetErr(&buf) |
| 94 | root.SetArgs(append([]string{"journal", "write", "--json", "--base-url", server.URL}, args...)) |
| 95 | |
| 96 | err := root.Execute() |
| 97 | var resp output.Response |
| 98 | if buf.Len() > 0 { |
| 99 | _ = json.Unmarshal(buf.Bytes(), &resp) |
| 100 | } |
| 101 | return resp, err |
| 102 | } |
| 103 |
nothing calls this directly
no test coverage detected