svoid test_pixelSpiral() { int maxW = 10, maxH = maxW; for (int w = 1; w <= maxW; w++) for (int h = 1; h <= maxH; h++) { print("Testing " + w + "*" + h); Set allPoints = asSet(allPointsInRect(w, h)); for x to w: for y to h: { print(" " + x + "/" + y); L l = asList(pixelSpiral(x, y, w, h)); assertEquals(l(l), w*h); assertEquals(asSet(l), allPoints); assertEquals(first(l), pt(x, y)); // We trust the remaining points are in the correct order } } print("pixelSpiral (probably) OK up to " + maxW + "*" + maxH); }