newTestEngine builds an Engine that writes its output into a buffer so the test can assert success/failure markers without having to shell out. workspaceRoot is set to the test's temp dir so validatePath admits the files we just created.
(t *testing.T, root string)
| 24 | // shell out. workspaceRoot is set to the test's temp dir so |
| 25 | // validatePath admits the files we just created. |
| 26 | func newTestEngine(t *testing.T, root string) (*Engine, *bytes.Buffer, *bytes.Buffer) { |
| 27 | t.Helper() |
| 28 | out := &bytes.Buffer{} |
| 29 | errBuf := &bytes.Buffer{} |
| 30 | return NewEngine(out, errBuf, root), out, errBuf |
| 31 | } |
| 32 | |
| 33 | // writeFile is a small wrapper that fails the test on write errors. |
| 34 | func writeFile(t *testing.T, dir, name, body string) string { |
no test coverage detected