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

Function TestMetaFile_FileHeaders

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

Source from the content-addressed store, hash-verified

77}
78
79func TestMetaFile_FileHeaders(t *testing.T) {
80 mFile, openErr := bfs.OpenMetaFile("testdata/test2.m", &sync.RWMutex{})
81 if openErr != nil {
82 if bfs.IsNotExist(openErr) {
83 return
84 }
85 t.Fatal(openErr)
86 }
87 _ = mFile.Close()
88 for hash, lazyHeader := range mFile.FileHeaders() {
89 header, err := lazyHeader.FileHeaderUnsafe()
90 if err != nil {
91 t.Fatal(err)
92 }
93 t.Log(hash, header.ModifiedAt, header.BodySize)
94 }
95}
96
97func TestMetaFile_WriteMeta(t *testing.T) {
98 mFile, err := bfs.OpenMetaFile("testdata/test.m", &sync.RWMutex{})

Callers

nothing calls this directly

Calls 6

OpenMetaFileFunction · 0.92
IsNotExistFunction · 0.92
FileHeadersMethod · 0.80
LogMethod · 0.80
CloseMethod · 0.65
FileHeaderUnsafeMethod · 0.45

Tested by

no test coverage detected