Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCinelli committed Nov 27, 2018
1 parent 0facf1b commit 2ce9d7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion filetree/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func BlankFileChangeInfo(path string) (f *FileInfo) {
result := FileInfo{
Path: path,
TypeFlag: 1,
Checksum: [16]byte{1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{1, 1, 1, 0, 1, 0, 0, 0},
}
return &result
}
20 changes: 10 additions & 10 deletions filetree/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func TestCompareWithNoChanges(t *testing.T) {
fakeData := FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
}
lowerTree.AddPath(value, fakeData)
upperTree.AddPath(value, fakeData)
Expand Down Expand Up @@ -294,15 +294,15 @@ func TestCompareWithAdds(t *testing.T) {
lowerTree.AddPath(value, FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
})
}

for _, value := range upperPaths {
upperTree.AddPath(value, FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
})
}

Expand Down Expand Up @@ -354,12 +354,12 @@ func TestCompareWithChanges(t *testing.T) {
lowerTree.AddPath(value, FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
})
upperTree.AddPath(value, FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{1, 0, 0, 0, 0, 0, 0, 0},
})
}

Expand Down Expand Up @@ -404,7 +404,7 @@ func TestCompareWithRemoves(t *testing.T) {
fakeData := FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
}
lowerTree.AddPath(value, fakeData)
}
Expand All @@ -413,7 +413,7 @@ func TestCompareWithRemoves(t *testing.T) {
fakeData := FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
}
upperTree.AddPath(value, fakeData)
}
Expand Down Expand Up @@ -474,7 +474,7 @@ func TestStackRange(t *testing.T) {
fakeData := FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
}
lowerTree.AddPath(value, fakeData)
}
Expand All @@ -483,7 +483,7 @@ func TestStackRange(t *testing.T) {
fakeData := FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
}
upperTree.AddPath(value, fakeData)
}
Expand All @@ -500,7 +500,7 @@ func TestRemoveOnIterate(t *testing.T) {
fakeData := FileInfo{
Path: value,
TypeFlag: 1,
Checksum: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
Checksum: [8]byte{0, 0, 0, 0, 0, 0, 0, 0},
}
node, err := tree.AddPath(value, fakeData)
if err == nil && stringInSlice(node.Path(), []string{"/etc"}) {
Expand Down

0 comments on commit 2ce9d7d

Please sign in to comment.