MCPcopy
hub / github.com/micro-editor/micro / createTestFile

Function createTestFile

cmd/micro/micro_test.go:168–184  ·  view source on GitHub ↗
(t *testing.T, content string)

Source from the content-addressed store, hash-verified

166}
167
168func createTestFile(t *testing.T, content string) string {
169 f, err := os.CreateTemp(t.TempDir(), "")
170 if err != nil {
171 t.Fatal(err)
172 }
173 defer func() {
174 if err := f.Close(); err != nil {
175 t.Fatal(err)
176 }
177 }()
178
179 if _, err := f.WriteString(content); err != nil {
180 t.Fatal(err)
181 }
182
183 return f.Name()
184}
185
186func TestMain(m *testing.M) {
187 var err error

Callers 3

TestSimpleEditFunction · 0.85
TestMouseFunction · 0.85
TestSearchAndReplaceFunction · 0.85

Calls 3

WriteStringMethod · 0.80
CloseMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected