From 1af67d9ca76e49198b8b8137e9fd24dfa4812203 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 13 Nov 2021 10:44:05 -0500 Subject: feat(gs/xanthous): Add a Husk creature, with limited generation Add a new "husk" creature raw, limited to only being generated on levels >= 1, including support for actually doing that limiting. These guys are gonna get daggers next! Change-Id: Ic4b58dc7ee36b50ced60fec6912cd1b46269d55c Reviewed-on: https://cl.tvl.fyi/c/depot/+/3868 Reviewed-by: grfn Tested-by: BuildkiteCI --- .../test/Xanthous/Entities/RawTypesSpec.hs | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 users/grfn/xanthous/test/Xanthous/Entities/RawTypesSpec.hs (limited to 'users/grfn/xanthous/test/Xanthous/Entities') diff --git a/users/grfn/xanthous/test/Xanthous/Entities/RawTypesSpec.hs b/users/grfn/xanthous/test/Xanthous/Entities/RawTypesSpec.hs new file mode 100644 index 000000000000..f5feb8a506db --- /dev/null +++ b/users/grfn/xanthous/test/Xanthous/Entities/RawTypesSpec.hs @@ -0,0 +1,28 @@ +-------------------------------------------------------------------------------- +module Xanthous.Entities.RawTypesSpec (main, test) where +-------------------------------------------------------------------------------- +import Test.Prelude +-------------------------------------------------------------------------------- +import Xanthous.Entities.RawTypes +-------------------------------------------------------------------------------- + +main :: IO () +main = defaultMain test + +test :: TestTree +test = testGroup "Xanthous.Entities.RawTypesSpec" + [ testGroup "CreatureGenerateParams" + [ testBatch $ monoid @CreatureGenerateParams mempty + , testGroup "canGenerate" + [ testProperty "no bounds" $ \level -> + let gps = CreatureGenerateParams Nothing Nothing + in canGenerate level gps + , testProperty "min bound" $ \level minB -> + let gps = CreatureGenerateParams (Just minB) Nothing + in canGenerate level gps === (level >= minB) + , testProperty "max bound" $ \level maxB -> + let gps = CreatureGenerateParams Nothing (Just maxB) + in canGenerate level gps === (level <= maxB) + ] + ] + ] -- cgit 1.4.1