Commit 5ac643ca authored by Kirill Smelkov's avatar Kirill Smelkov

tests/BenchmarkDecode: Skip empty pickles from tests table

In 06e06939 (encoder: Allow to specify pickle protocol version) I added
ability to add to tests error cases - object inputs that on encoding
should produce error.

For decoding we should skip those cases as there pickle.data = "", and
if not skipped it leads to

	--- FAIL: BenchmarkDecode
	    ogorek_test.go:803: unexpected # of decode steps: got 100  ; want 102
parent e7b816f0
...@@ -773,6 +773,9 @@ func BenchmarkDecode(b *testing.B) { ...@@ -773,6 +773,9 @@ func BenchmarkDecode(b *testing.B) {
npickle := 0 npickle := 0
for _, test := range tests { for _, test := range tests {
for _, pickle := range test.picklev { for _, pickle := range test.picklev {
if pickle.err != nil {
continue
}
// not prepending `PROTO <ver>` - decoder should be // not prepending `PROTO <ver>` - decoder should be
// able to decode without it. // able to decode without it.
input = append(input, pickle.data...) input = append(input, pickle.data...)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment