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

Function TestCopyFile_LargeFile

internal/engine/single/downloader_test.go:103–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func TestCopyFile_LargeFile(t *testing.T) {
104 tmpDir, cleanup, _ := testutil.TempDir("surge-copy-test")
105 defer cleanup()
106
107 size := int64(5 * types.MB)
108 srcPath, _ := testutil.CreateTestFile(tmpDir, "large.bin", size, false)
109 dstPath := filepath.Join(tmpDir, "large_copy.bin")
110
111 err := utils.CopyFile(srcPath, dstPath)
112 if err != nil {
113 t.Fatalf("copyFile failed for large file: %v", err)
114 }
115
116 if err := testutil.VerifyFileSize(dstPath, size); err != nil {
117 t.Error(err)
118 }
119}
120
121func TestCopyFile_ContentVerification(t *testing.T) {
122 tmpDir, cleanup, _ := testutil.TempDir("surge-copy-content")

Callers

nothing calls this directly

Calls 5

TempDirFunction · 0.92
CreateTestFileFunction · 0.92
CopyFileFunction · 0.92
VerifyFileSizeFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected