func openImage(t *testing.T, path string) image.Image { fireTruck, err := os.Open(path) assert.NoError(t, err, "error openenig image") img, err := jpeg.Decode(fireTruck) assert.NoError(t, err, "error decoding image") return img }
func Test4pieceJigsaw(t *testing.T) { img := openImage(t, JPG_SAMPLE) builder := jigsaw.NewJigsawBuilder(img, 24) jig, err := builder.Build() assert.NoError(t, err, "did not expect an error") assert.NotNil(t, jig, "expected jigsaw") // for _, p := range jig.Pieces { // assert.True(t, p.IsCorner, "should be a corner") // } }