28 lines
664 B
Haskell
28 lines
664 B
Haskell
module Main where
|
|
|
|
import MiniPlan.Build
|
|
( BuildPlan (BuildPlan)
|
|
, Mode (Release)
|
|
, Output (Quiet)
|
|
, Target (Executable)
|
|
, defaultPlan
|
|
, describePlan
|
|
, parsePlan
|
|
)
|
|
import System.Exit (die)
|
|
|
|
main :: IO ()
|
|
main =
|
|
case
|
|
( parsePlan []
|
|
, parsePlan ["executable", "release", "quiet"]
|
|
, describePlan (BuildPlan Executable Release Quiet)
|
|
) of
|
|
( Right parsedDefault
|
|
, Right parsedCustom
|
|
, "build the executable in release mode quietly"
|
|
) | parsedDefault == defaultPlan
|
|
&& parsedCustom == BuildPlan Executable Release Quiet ->
|
|
putStrLn "test passed"
|
|
_ -> die "unexpected plan parsing result"
|