MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestMetaFile_Write

Function TestMetaFile_Write

internal/utils/bfs/meta_file_test.go:135–155  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

133}
134
135func TestMetaFile_Write(t *testing.T) {
136 mFile, err := bfs.OpenMetaFile("testdata/test.m", &sync.RWMutex{})
137 if err != nil {
138 t.Fatal(err)
139 }
140 defer func() {
141 _ = mFile.Close()
142 }()
143
144 var hash = bfs.Hash("123456")
145
146 err = mFile.WriteBodyBlockUnsafe(hash, 0, 100, 0, 100)
147 if err != nil {
148 t.Fatal(err)
149 }
150
151 err = mFile.WriteClose(hash, 0, 100)
152 if err != nil {
153 t.Fatal(err)
154 }
155}
156
157func TestMetaFile_RemoveFile(t *testing.T) {
158 mFile, err := bfs.OpenMetaFile("testdata/test.m", &sync.RWMutex{})

Callers

nothing calls this directly

Calls 5

OpenMetaFileFunction · 0.92
HashFunction · 0.92
WriteBodyBlockUnsafeMethod · 0.80
WriteCloseMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected