module Main where import MiniDeriving.Batch ( Environment (Production, Staging) , FailureBudget (FailureBudget) , Priority (Background, Standard, Urgent) , ReleaseTarget (ReleaseTarget) , allEnvironments , mergeBatches , platformBatch , renderBatch , sortedTargets , totalFailureBudget , urgentFixBatch ) import System.Exit (die) main :: IO () main = case ( allEnvironments , sortedTargets (mergeBatches platformBatch urgentFixBatch) , totalFailureBudget (mergeBatches platformBatch urgentFixBatch) ) of ( [Staging, Production] , [ ReleaseTarget Staging Urgent "billing" 1 , ReleaseTarget Staging Background "worker" 1 , ReleaseTarget Production Urgent "auth" 2 , ReleaseTarget Production Standard "api" 3 ] , FailureBudget 7 ) | head (lines (renderBatch (mergeBatches platformBatch urgentFixBatch))) == "batch platform+urgent-fix across 2 environments with failure budget 7" -> putStrLn "test passed" _ -> die "unexpected derived behavior"