initial commit

This commit is contained in:
2025-08-01 18:44:48 +09:00
commit d0e1d01de1
20 changed files with 542 additions and 0 deletions

27
test/Spec.hs Normal file
View File

@@ -0,0 +1,27 @@
import Control.Lens
import OneCommand.Command
import OneCommand.Generator (generateCommandChainGroup, pos)
import OneCommand.PosUtil (Vec3i (Vec3i), vec)
import Test.Hspec
main :: IO ()
main = hspec $ do
describe "command generation" $ do
it "generate command normally" $ do
let myChains =
[ CommandChain
{ commands = ["1", "2"],
chainType = RepeatingChain
},
CommandChain
{ commands = ["3", "4"],
chainType = ImpulseChain
}
]
let cmds = generateCommandChainGroup myChains
(head cmds ^. pos . vec) `shouldBe` Vec3i 0 0 0
(cmds !! 1 ^. pos . vec) `shouldBe` Vec3i 0 0 1
(cmds !! 2 ^. pos . vec) `shouldBe` Vec3i 0 2 0
(cmds !! 3 ^. pos . vec) `shouldBe` Vec3i 0 2 1