Skip to content

Commit

Permalink
Added test for ParseStringToTlsh function
Browse files Browse the repository at this point in the history
  • Loading branch information
melehin committed Jul 25, 2019
1 parent 8052b87 commit dd8a681
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tlsh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ func TestDiff(t *testing.T) {
}
}

func TestParseStringToTlsh(t *testing.T) {
for _, tc := range hashTestCases {
if hash, err := ParseStringToTlsh(tc.hash); err != nil || hash.String() != tc.hash {
if err != nil {
t.Error(err)
}
if hash.String() != tc.hash {
t.Errorf("\noriginal and parsed tlsh have different hash %s vs. %s\n", tc.hash, hash.String())
}
}
}
}

func BenchmarkPearson(b *testing.B) {
var salt = byte(0)
var keys = [3]byte{1, 3, 7}
Expand Down

0 comments on commit dd8a681

Please sign in to comment.