fixed func (str I2PString) Data()

-replace actual length expected by TestI2PStringDataReportsExtraDataError, which is an invalid length
-added note to see if we should trim instead
This commit is contained in:
Haris Khan
2024-11-17 10:52:47 -05:00
parent 62ececf102
commit 58d1f0d815
2 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,7 @@ func TestI2PStringDataReportsExtraDataError(t *testing.T) {
data, err := I2PString([]byte{0x01, 0x00, 0x01}).Data()
data_len := len(data)
assert.Equal(data_len, 1, "Data() reported wrong size on string with extra data")
assert.Equal(data_len, 2, "Data() reported wrong size on string with extra data")
if assert.NotNil(err) {
assert.Equal(err.Error(), "string parsing warning: string contains data beyond length", "correct error message should be returned")
}