MCPcopy
hub / github.com/SurgeDM/Surge / TestCreateTestFile

Function TestCreateTestFile

internal/testutil/mock_server_test.go:314–329  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

312}
313
314func TestCreateTestFile(t *testing.T) {
315 dir, cleanup, err := TempDir("surge-test")
316 if err != nil {
317 t.Fatal(err)
318 }
319 defer cleanup()
320
321 path, err := CreateTestFile(dir, "test.bin", 1024, false)
322 if err != nil {
323 t.Fatalf("Failed to create test file: %v", err)
324 }
325
326 if err := VerifyFileSize(path, 1024); err != nil {
327 t.Error(err)
328 }
329}
330
331func TestVerifyFileSize(t *testing.T) {
332 dir, cleanup, _ := TempDir("surge-test")

Callers

nothing calls this directly

Calls 4

TempDirFunction · 0.85
CreateTestFileFunction · 0.85
VerifyFileSizeFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected