Skip to content

Commit cfbeab5

Browse files
authored
attribute: clarify xxhash test purpose (#8753)
## Description: Issue #7616 asks whether `TestIntegrity` is needed in the `attribute/internal/xxhash` tests because its purpose was not clear. This PR keeps the test, renames it, and documents what it verifies: hashing a string prefix and a `uint64` suffix should match hashing the equivalent byte sequence directly, which depends on `Uint64` using little-endian encoding. Closes #7616. --------- Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
1 parent 3599b59 commit cfbeab5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

attribute/internal/xxhash/xxhash_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
)
1212

1313
func TestIntegrity(t *testing.T) {
14+
// Verify hashing a string prefix and a uint64 suffix produces the same
15+
// digest as hashing the equivalent byte sequence directly. This ensures
16+
// Uint64 uses the expected little-endian byte encoding.
1417
data := []byte{'1', '2', 3, 4, 5, 6, 7, 8, 9, 10}
1518
h0 := New()
1619
want := h0.String(string(data))

0 commit comments

Comments
 (0)