Update test suite to use vty-crossplatform

This commit is contained in:
Jonathan Daugherty 2023-12-15 09:34:56 -08:00
parent 01827e29c7
commit 31f94e1b76
3 changed files with 4 additions and 4 deletions

View File

@ -575,5 +575,5 @@ test-suite brick-tests
microlens, microlens,
vector, vector,
vty, vty,
vty-unix, vty-crossplatform,
QuickCheck QuickCheck

View File

@ -1,3 +1,4 @@
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeFamilies #-}

View File

@ -10,8 +10,7 @@ import Control.Monad (when)
import Data.Monoid import Data.Monoid
#endif #endif
import qualified Graphics.Vty as V import qualified Graphics.Vty as V
import qualified Graphics.Vty.Platform.Unix.Output as VU import qualified Graphics.Vty.CrossPlatform.Testing as V
import qualified Graphics.Vty.Platform.Unix.Settings as VU
import Brick.Widgets.Border (hBorder) import Brick.Widgets.Border (hBorder)
import Control.Exception (SomeException, try) import Control.Exception (SomeException, try)
@ -20,7 +19,7 @@ region = (30, 10)
renderDisplay :: Ord n => [Widget n] -> IO () renderDisplay :: Ord n => [Widget n] -> IO ()
renderDisplay ws = do renderDisplay ws = do
outp <- VU.buildOutput =<< VU.defaultSettings outp <- V.mkDefaultOutput
ctx <- V.displayContext outp region ctx <- V.displayContext outp region
V.outputPicture ctx (renderWidget Nothing ws region) V.outputPicture ctx (renderWidget Nothing ws region)
V.releaseDisplay outp V.releaseDisplay outp