(t *testing.T, fn func())
| 60 | } |
| 61 | |
| 62 | func captureOutput(t *testing.T, fn func()) string { |
| 63 | t.Helper() |
| 64 | old := os.Stdout |
| 65 | r, w, err := os.Pipe() |
| 66 | assert.NoError(t, err) |
| 67 | os.Stdout = w |
| 68 | |
| 69 | fn() |
| 70 | |
| 71 | w.Close() |
| 72 | os.Stdout = old |
| 73 | |
| 74 | var buf bytes.Buffer |
| 75 | buf.ReadFrom(r) |
| 76 | return buf.String() |
| 77 | } |
| 78 | |
| 79 | func TestNewAliasCommand_Structure(t *testing.T) { |
| 80 | cmd := NewAliasCommand() |
no test coverage detected