module OtherCommandTest whereimport Test.Tastyimport Test.Tasty.HUnitimport GHCup.OptParseimport Utilsimport Control.Monad.IO.ClassotherCommandTests :: TestTreeotherCommandTests = testGroup "other command" [ testCase "debug-info" $ do res <- parseWith ["debug-info"] liftIO $ assertBool "debug-info parse failed" (isDInfo res) , testCase "tool-requirements" $ do ToolRequirements opt <- parseWith ["tool-requirements"] liftIO $ tlrRaw opt @?= False , testCase "tool-requirements -r" $ do ToolRequirements opt <- parseWith ["tool-requirements", "--raw-format"] liftIO $ tlrRaw opt @?= True , testCase "nuke" $ do res <- parseWith ["nuke"] liftIO $ assertBool "nuke parse failed" (isNuke res) , testCase "test ghc" $ do res <- parseWith ["test", "ghc"] liftIO $ assertBool "test parse failed" (isTest res) ]isDInfo :: Command -> BoolisDInfo DInfo = TrueisDInfo _ = FalseisNuke :: Command -> BoolisNuke Nuke = TrueisNuke _ = FalseisTest :: Command -> BoolisTest (Test _) = TrueisTest _ = False