Skip to content

Instantly share code, notes, and snippets.

{-# 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)

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

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
@romanofski
romanofski / bar.sh
Created April 16, 2019 10:24
test reproducer for exec/bash tempfile
#!/bin/sh
sleep 1
set -e
cat $1
@romanofski
romanofski / termonadNixOS
Last active December 29, 2018 10:11
termonad compilation problems
% result/bin/termonad
Configuration '/home/rjoost/.config/termonad/termonad.hs' changed. Recompiling.
Error occurred while loading configuration file.
/home/rjoost/.config/termonad/termonad.hs:7:1: error:
Could not find module ‘Termonad’
Use -v to see a list of the files searched for.
|
7 | import Termonad
@romanofski
romanofski / bfpg-purebred-proposal.md
Last active September 12, 2018 23:33
Talk proposal for BFPG about Purebred

Real World Haskell: A TUI e-mail client

There is a myriad of free software e-mail clients to choose from. However only few support a text user interface and fast indexing.

Talk Outline:

  • Quick introduction to brick and how to build text user interfaces
  • How do we extensively test purebred
  • What have we done to leverage Haskell to build a better client than what is available today
  • What have we learned so far
This file has been truncated, but you can view the full file.
Sat Oct 1 09:37 2016 Time and Allocation Profiling Report (Final)
benchmark-csv-import +RTS -p -RTS
total time = 483.97 secs (483969 ticks @ 1000 us, 1 processor)
total alloc = 36,758,849,576 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
stepError Database.Sqlite 92.6 0.0
@romanofski
romanofski / kiwipycon2016proposal.md
Last active June 20, 2016 04:29
KiwiPyCon 2016 Proposal

Application Development from the Users Perspective

Short description

The talk gives first hand experience on creating personas - a usability tool for designing user interfaces - and how to incorporate them in the design process.

Long description

Personas are hypothetical users which you can use when designing features for your application, to anticipate user interaction based on their goals. One of many problems in software engineering is providing consistent and easy to use user interfaces. How do you know what UI enables your users to get things done? How do you find a solution if you have conflicting interests? How do you build an interface, which doesn't leave decisions about configuration of the UI up to the user.

This talk will offer a solution to these questions by making use of personas. It will give first hand experience from developing personas for Beaker: from user interviews to how we incorporate them in our design process.