Display multiple messages per turn
When tracking message history, save messages associated with the turn they were displayed on, which allows us to have the notion of the "current turn's" messages (provided via a MonoComonad instance).
This commit is contained in:
parent
272ff5b3e6
commit
5c6ba40019
7 changed files with 84 additions and 28 deletions
|
|
@ -30,4 +30,16 @@ test = testGroup "Xanthous.Game"
|
|||
, testGroup "character"
|
||||
[ testProperty "lens laws" $ isLens character
|
||||
]
|
||||
, localOption (QuickCheckTests 10)
|
||||
$ testGroup "MessageHistory"
|
||||
[ testGroup "MonoComonad laws"
|
||||
[ testProperty "oextend oextract ≡ id"
|
||||
$ \(mh :: MessageHistory) -> oextend oextract mh === mh
|
||||
, testProperty "oextract ∘ oextend f ≡ f"
|
||||
$ \(mh :: MessageHistory) f -> (oextract . oextend f) mh === f mh
|
||||
, testProperty "oextend f ∘ oextend g ≡ oextend (f . oextend g)"
|
||||
$ \(mh :: MessageHistory) f g ->
|
||||
(oextend f . oextend g) mh === oextend (f . oextend g) mh
|
||||
]
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue