router address tests

This commit is contained in:
Hayden Parker
2016-02-12 00:21:27 -08:00
parent 1af45068d4
commit 7e9aee0714
4 changed files with 111 additions and 18 deletions

View File

@ -105,8 +105,8 @@ func TestToI2PStringReportsOverflows(t *testing.T) {
func TestReadStringReadsLength(t *testing.T) {
bytes := []byte{0x01, 0x04, 0x06}
str, remainder, err := ReadString(bytes)
if err == nil || err.Error() != "string parsing warning: string contains data beyond length" {
t.Fatal("ReadString() returned incorrect error,", err)
if err != nil {
t.Fatal("ReadString() returned error reading string with extra data,", err)
}
if len(str) != 2 {
t.Fatal("ReadString() did not return correct string length:", len(str))