Skip to content

Commit

Permalink
Add a separate test for unsafely iterating the tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinconaway committed Dec 11, 2021
1 parent b43253e commit a28593a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions process/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ func (suite *TagSerdeTestSuite) TestTagSerdeRealTags() {
})
assert.Equal(suite.T(), allTags[i], iterated)

var unsafeIterated []string
unsafeIterateTags(encoder.Buffer(), tagIndex, func(i, total int, tag []byte) bool {
unsafeIterated = append(unsafeIterated, string(tag))
return true
})
assert.Equal(suite.T(), allTags[i], unsafeIterated)

iterated = nil
iterateTags(encoder.Buffer(), tagIndex, func(i, total int, tag string) bool {
if i == total-1 {
Expand Down

0 comments on commit a28593a

Please sign in to comment.