Skip to content

Instantly share code, notes, and snippets.

mkEntity = EntityCommand
(const . pure)
(tmpfileResource (view mhKeepTemp cmd))
(\_ fp -> toProcessConfigWithTempfile (view mhMakeProcess cmd) fp)
mkConfig :: (MonadError Error m) => m (EntityCommand a FilePath)
mkConfig =
case maybeEntity of
Nothing -> throwError (GenericError "No attachment selected")
Just e -> either throwError (pure . mkEntity) $ entityToBytes e

Automated acceptance tests for terminal applications

Acceptance testing is a method of testing an application from a users point of view. In this talk, I will demonstrate our approach to full automated testing a terminal email application (purebred) with the tasty-tmux framework. I'll elaborate the benefits and trade-offs, what problems we experienced and how we solved them.

Automating acceptance testing is challenging, because the tests can not adapt to timing sensitive changes in the

{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text as T
import Control.Lens
import Data.Functor.Compose
newtype Mailbody = Mailbody [Paragraph]
deriving (Show)
data Line = Line Int T.Text
deriving (Show)