This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
utils/merkletrie/filesystem Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,42 @@ func (s *NoderSuite) TestDiffChangeContent(c *C) {
8282 c .Assert (ch , HasLen , 1 )
8383}
8484
85+ func (s * NoderSuite ) TestDiffSymlinkDirOnA (c * C ) {
86+ fsA := memfs .New ()
87+ WriteFile (fsA , "qux/qux" , []byte ("foo" ), 0644 )
88+
89+ fsB := memfs .New ()
90+ fsB .Symlink ("qux" , "foo" )
91+ WriteFile (fsB , "qux/qux" , []byte ("foo" ), 0644 )
92+
93+ ch , err := merkletrie .DiffTree (
94+ NewRootNode (fsA , nil ),
95+ NewRootNode (fsB , nil ),
96+ IsEquals ,
97+ )
98+
99+ c .Assert (err , IsNil )
100+ c .Assert (ch , HasLen , 1 )
101+ }
102+
103+ func (s * NoderSuite ) TestDiffSymlinkDirOnB (c * C ) {
104+ fsA := memfs .New ()
105+ fsA .Symlink ("qux" , "foo" )
106+ WriteFile (fsA , "qux/qux" , []byte ("foo" ), 0644 )
107+
108+ fsB := memfs .New ()
109+ WriteFile (fsB , "qux/qux" , []byte ("foo" ), 0644 )
110+
111+ ch , err := merkletrie .DiffTree (
112+ NewRootNode (fsA , nil ),
113+ NewRootNode (fsB , nil ),
114+ IsEquals ,
115+ )
116+
117+ c .Assert (err , IsNil )
118+ c .Assert (ch , HasLen , 1 )
119+ }
120+
85121func (s * NoderSuite ) TestDiffChangeMissing (c * C ) {
86122 fsA := memfs .New ()
87123 WriteFile (fsA , "foo" , []byte ("foo" ), 0644 )
You can’t perform that action at this time.
0 commit comments