about summary refs log tree commit diff
path: root/test/Xanthous/Util
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-12-25T00·40-0500
committerGriffin Smith <root@gws.fyi>2019-12-30T16·24-0500
commit6f427fe4d6ba9a03f122d15839298040a7cfb925 (patch)
tree5ab6c11d7b1f4109e1d196f9d1135cbb4bd828f6 /test/Xanthous/Util
parent13516911366a484ee5484166520133e056010515 (diff)
Fix circle rendering, add filled circle
Make raster circle rendering use the Rasterific package instead of
attempting desperately to hand-roll it, and add a method for generating
filled circles.
Diffstat (limited to 'test/Xanthous/Util')
-rw-r--r--test/Xanthous/Util/GraphicsSpec.hs33
1 files changed, 20 insertions, 13 deletions
diff --git a/test/Xanthous/Util/GraphicsSpec.hs b/test/Xanthous/Util/GraphicsSpec.hs
index 4b761dc51fe9..ecd6dbe19197 100644
--- a/test/Xanthous/Util/GraphicsSpec.hs
+++ b/test/Xanthous/Util/GraphicsSpec.hs
@@ -15,19 +15,26 @@ test = testGroup "Xanthous.Util.Graphics"
   [ testGroup "circle"
     [ testCase "radius 12, origin 0"
       $ (sort . unique @[] @[_]) (circle @Int (0, 0) 12)
-      @?= (sort . unique) (
-        let quadrant =
-              [ (0, 12) , (1, 12) , (2, 12) , (3, 12)
-              , (4, 12) , (5, 11) , (6, 11) , (7, 10)
-              , (8, 9)  , (9, 9)  , (9, 8)  , (10, 7)
-              , (11, 6) , (11, 5) , (12, 4) , (12, 3)
-              , (12, 2) , (12, 1) , (12, 0)
-              ]
-        in  quadrant
-         <> (quadrant <&> _1 %~ negate)
-         <> (quadrant <&> _2 %~ negate)
-         <> (quadrant <&> both %~ negate)
-      )
+      @?= [ (1,12)
+          , (2,12)
+          , (3,12)
+          , (4,12)
+          , (5,12)
+          , (6,11)
+          , (7,10)
+          , (7,11)
+          , (8,10)
+          , (9,9)
+          , (10,7)
+          , (10,8)
+          , (11,6)
+          , (11,7)
+          , (12,1)
+          , (12,2)
+          , (12,3)
+          , (12,4)
+          , (12,5)
+          ]
     ]
 
   , testGroup "line"