optics icon indicating copy to clipboard operation
optics copied to clipboard

Composable `ghc*failure`.

Open phadej opened this issue 7 months ago • 0 comments

With more GHC versions we end up with predicates looking like

ghc92and94and9122failure :: Result -> IO ()
#if (__GLASGOW_HASKELL__ >= 902 && __GLASGOW_HASKELL__ <= 904) || GHC_9122
ghc92and94and9122failure = assertFailure'
#else
ghc92and94and9122failure = assertSuccess
#endif

I suggest that we refactor these so we'd rather write tests as

assertSucceessExcept (ghc92 || ghc94 || ghc9122) $ $(lhsFoo ==~ rhsFoo)

phadej avatar Jun 17 '25 19:06 phadej