MCPcopy
hub / github.com/syncthing/syncthing / equalContents

Function equalContents

lib/model/requests_test.go:599–613  ·  view source on GitHub ↗
(fs fs.Filesystem, path string, contents []byte)

Source from the content-addressed store, hash-verified

597}
598
599func equalContents(fs fs.Filesystem, path string, contents []byte) error {
600 fd, err := fs.Open(path)
601 if err != nil {
602 return err
603 }
604 defer fd.Close()
605 bs, err := io.ReadAll(fd)
606 if err != nil {
607 return err
608 }
609 if !bytes.Equal(bs, contents) {
610 return errors.New("incorrect data")
611 }
612 return nil
613}
614
615func TestRequestRemoteRenameChanged(t *testing.T) {
616 t.Skip("flaky")

Callers 3

TestRequestSimpleFunction · 0.85

Calls 4

OpenMethod · 0.65
CloseMethod · 0.65
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected