gots icon indicating copy to clipboard operation
gots copied to clipboard

packet: tests ignore errors in set up

Open kortschak opened this issue 7 years ago • 2 comments

In #97 I found that the test was failing got go1.9 or lower, but not above. I tracked this down to a failure of the set up to provide an non-empty input string because hex.DecodeString was given an odd-length string. The call to hex.DecodeString in the tests in "io_test.go" ignore the "error" returned allowing this kind of test corruption.

kortschak avatar Aug 09 '18 10:08 kortschak

I was wondering about that, but I didn't have time to track it down. Good catch!

WillGunther avatar Aug 09 '18 22:08 WillGunther

In the big change to arrays I changed the string parse to panic on error on the basis that tests should fail very noisily if the hard-coded constants are wrong. In the PR I discovered this in, I have just fixed one of them to Fatalf if it's wrong.

kortschak avatar Aug 09 '18 22:08 kortschak