package me.mattlogan.artiste;

import android.graphics.Path;
import android.graphics.PathMeasure;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;

@RunWith(AndroidJUnit4.class)
@SmallTest
public class PathsTest {

    @Test
    public void testCircle() {
        Path circle = Paths.circle(0, 0, 100, 100);
        PathMeasure pm = new PathMeasure(circle, false);
        assertEquals(314, pm.getLength(), 1);
    }
}

@@ -298,16 +298,59 @@
 tEquals;
+%0Aimport static org.junit.Assert.assertTrue;
 %0A%0A@RunWi
@@ -418,197 +418,2388 @@
     
-@Test%0A    public void testCircle() %7B%0A        Path circle = Paths.circle(0, 0, 100, 100);%0A        PathMeasure pm = new PathMeasure(circle, false);%0A        assertEquals(314, pm.getLength(), 1
+/*%0A    This is an easy one. In a square of side lengths 100, the diameter of the inscribed circle%0A    is 100. So the perimeter of our circle should be roughly 100 * 3.14 = 314.%0A     */%0A    @Test%0A    public void testCircle() %7B%0A        Path path = Paths.circle(0, 0, 100, 100);%0A        PathMeasure pm = new PathMeasure(path, false);%0A        assertEquals(314, pm.getLength(), 1);%0A    %7D%0A%0A    /*%0A    Non-square bounds should throw.%0A     */%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testCircleThrowsWithNonSquareBounds() %7B%0A        Paths.circle(0, 0, 100, 99);%0A    %7D%0A%0A    /*%0A    Check the perimeter of a regular convex polygon.%0A     */%0A    @Test%0A    public void testRegularConvexPolygonSquarePerimeter() %7B%0A        Path path = Paths.regularConvexPolygon(0, 0, 100, 100, 4, 0);%0A        PathMeasure pm = new PathMeasure(path, false);%0A%0A        // Perimeter of square inscribed in circle with diameter 100%0A        float expectedPerimeter = 282.84f;%0A%0A        assertEquals(expectedPerimeter, pm.getLength(), 0.01f);%0A    %7D%0A%0A    /*%0A    Make sure that rotation has no effect on the perimeter of a regular convex polygon.%0A     */%0A    @Test%0A    public void testRegularConvexPolygonPerimeterIsRotationIndependent() %7B%0A        Path path1 = Paths.regularConvexPolygon(0, 0, 100, 100, 5, 0);%0A        PathMeasure pm1 = new PathMeasure(path1, false);%0A%0A        Path path2 = Paths.regularConvexPolygon(0, 0, 100, 100, 5, 60);%0A        PathMeasure pm2 = new PathMeasure(path2, false);%0A%0A        assertEquals(pm1.getLength(), pm2.getLength(), 0);%0A    %7D%0A%0A    /*%0A    Check relative magnitudes of regular convex polygon perimeters. For example, a pentagon should%0A    have a slightly larger perimeter than a square if both are inscribed in the same circle.%0A     */%0A    @Test%0A    public void testRelativePerimetersOfRegularConvexPolygons() %7B%0A        Path path1 = Paths.regularConvexPolygon(0, 0, 100, 100, 6, 0);%0A        PathMeasure pm1 = new PathMeasure(path1, false);%0A%0A        Path path2 = Paths.regularConvexPolygon(0, 0, 100, 100, 7, 0);%0A        PathMeasure pm2 = new PathMeasure(path2, false);%0A%0A        assertTrue(pm2.getLength() %3E pm1.getLength());%0A    %7D%0A%0A    /*%0A    Non-square bounds should throw.%0A     */%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testRegularConvexPolygonThrowsWithNonSquareBounds() %7B%0A        Paths.regularConvexPolygon(0, 0, 100, 99, 4, 0
 );%0A 

Add tests for Paths.regularConvexPolygon()