MCPcopy Create free account
hub / github.com/diillson/chatcli / newTestEngine

Function newTestEngine

pkg/coder/engine/multipatch_test.go:26–31  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

24// shell out. workspaceRoot is set to the test's temp dir so
25// validatePath admits the files we just created.
26func 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.
34func writeFile(t *testing.T, dir, name, body string) string {

Calls 1

NewEngineFunction · 0.70

Tested by

no test coverage detected