Skip to content

Commit

Permalink
pray for edge case to not happen in test
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Jun 19, 2023
1 parent c3270b7 commit 2046250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions share/getters/shrex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestShrexGetter(t *testing.T) {
// corrupt NID
nID := make([]byte, ipld.NamespaceSize)
copy(nID, maxNID)
nID[ipld.NamespaceSize-1]--
nID[ipld.NamespaceSize-1]-- // pray for last byte to not be 0x00
// check for namespace to be between max and min namespace in root
require.Len(t, filterRootsByNamespace(&dah, maxNID), 1)

Expand All @@ -130,7 +130,7 @@ func TestShrexGetter(t *testing.T) {
// corrupt NID
nID := make([]byte, ipld.NamespaceSize)
copy(nID, maxNID)
nID[ipld.NamespaceSize-1]++
nID[ipld.NamespaceSize-1]++ // pray for last byte to not be 0xFF
// check for namespace to be not in root
require.Len(t, filterRootsByNamespace(&dah, nID), 0)

Expand Down

0 comments on commit 2046250

Please sign in to comment.