Captures the uncompressed path.
(t *testing.T)
| 293 | |
| 294 | // Captures the uncompressed path. |
| 295 | func TestLoopEncodeDecode(t *testing.T) { |
| 296 | pts := parsePoints("30:20, 40:20, 39:43, 33:35") |
| 297 | loops := []*Loop{LoopFromPoints(pts), EmptyLoop(), FullLoop()} |
| 298 | for i, l := range loops { |
| 299 | var buf bytes.Buffer |
| 300 | l.Encode(&buf) |
| 301 | ll := new(Loop) |
| 302 | if err := ll.Decode(&buf); err != nil { |
| 303 | t.Errorf("Decode %d: %v", i, err) |
| 304 | continue |
| 305 | } |
| 306 | if !reflect.DeepEqual(l, ll) { |
| 307 | t.Errorf("encoding roundtrip failed") |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | func TestLoopEncodeDecodeFuzzed(t *testing.T) { |
| 313 | for i := 3; i < 100; i++ { |
nothing calls this directly
no test coverage detected
searching dependent graphs…