mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
update tests for changes in config process
This commit is contained in:
parent
6f1a9f60f6
commit
cbe30a71a3
@ -4,11 +4,6 @@ module Main where
|
||||
import Graphics.Vty.Config
|
||||
import Graphics.Vty.Input.Events
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Exception
|
||||
import Control.Lens ((^.))
|
||||
import Control.Monad
|
||||
|
||||
import Data.Default
|
||||
import Data.String.QQ
|
||||
|
||||
@ -16,8 +11,6 @@ import Test.Framework
|
||||
import Test.Framework.Providers.HUnit
|
||||
import Test.HUnit hiding (Test)
|
||||
|
||||
import Text.Printf
|
||||
|
||||
exampleConfig :: String
|
||||
exampleConfig = [s|
|
||||
-- comments should be ignored.
|
||||
|
@ -12,9 +12,11 @@ import Verify.Graphics.Vty.Output
|
||||
|
||||
import Control.Monad
|
||||
|
||||
import Data.Default
|
||||
|
||||
import qualified System.Console.Terminfo as Terminfo
|
||||
import System.Posix.Env
|
||||
import System.IO
|
||||
import System.Posix.IO
|
||||
|
||||
tests :: IO [Test]
|
||||
tests = concat <$> forM terminalsOfInterest (\termName -> do
|
||||
@ -45,8 +47,8 @@ smokeTestTermMac termName i = liftIOResult $ do
|
||||
|
||||
smokeTestTerm :: String -> Image -> IO Result
|
||||
smokeTestTerm termName i = do
|
||||
nullOut <- openFile "/dev/null" WriteMode
|
||||
t <- outputForNameAndIO termName nullOut
|
||||
nullOut <- openFd "/dev/null" WriteOnly Nothing defaultFileFlags
|
||||
t <- outputForConfig $ def { outputFd = Just nullOut, termName = Just termName }
|
||||
-- putStrLn $ "context color count: " ++ show (contextColorCount t)
|
||||
reserveDisplay t
|
||||
dc <- displayContext t (100,100)
|
||||
@ -59,5 +61,6 @@ smokeTestTerm termName i = do
|
||||
showCursor t
|
||||
releaseDisplay t
|
||||
releaseTerminal t
|
||||
closeFd nullOut
|
||||
return succeeded
|
||||
|
||||
|
@ -110,7 +110,12 @@ assertEventsFromSynInput table inputSpec expectedEvents = do
|
||||
(writeFd, readFd) <- openPseudoTerminal
|
||||
(setTermAttr,_) <- attributeControl readFd
|
||||
setTermAttr
|
||||
input <- initInputForFd def "dummy" table readFd
|
||||
let testConfig = def { inputFd = Just readFd
|
||||
, termName = Just "dummy"
|
||||
, vmin = Just 1
|
||||
, vtime = Just 100
|
||||
}
|
||||
input <- initInput testConfig table
|
||||
eventsRef <- newIORef []
|
||||
let writeWaitClose = do
|
||||
synthesizeInput inputSpec writeFd
|
||||
|
33
vty.cabal
33
vty.cabal
@ -137,7 +137,7 @@ test-suite verify-attribute-ops
|
||||
hs-source-dirs: test
|
||||
test-module: VerifyAttributeOps
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -169,7 +169,7 @@ test-suite verify-using-mock-terminal
|
||||
Verify.Graphics.Vty.Output
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -202,12 +202,13 @@ test-suite verify-terminal
|
||||
Verify.Graphics.Vty.Output
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
bytestring,
|
||||
containers,
|
||||
data-default >= 0.5.3,
|
||||
deepseq >= 1.1 && < 1.4,
|
||||
mtl >= 1.1.1.0 && < 2.3,
|
||||
terminfo >= 0.3 && < 0.5,
|
||||
@ -235,7 +236,7 @@ test-suite verify-display-attributes
|
||||
Verify.Graphics.Vty.Span
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -261,7 +262,7 @@ test-suite verify-empty-image-props
|
||||
other-modules: Verify
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -288,7 +289,7 @@ test-suite verify-eval-terminfo-caps
|
||||
Verify.Graphics.Vty.Output
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -318,7 +319,7 @@ test-suite verify-image-ops
|
||||
Verify.Graphics.Vty.Image
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -346,7 +347,7 @@ test-suite verify-image-trans
|
||||
Verify.Graphics.Vty.Image
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -373,7 +374,7 @@ test-suite verify-inline
|
||||
Verify.Graphics.Vty.Output
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -401,7 +402,7 @@ test-suite verify-parse-terminfo-caps
|
||||
Verify.Graphics.Vty.Output
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -433,7 +434,7 @@ test-suite verify-simple-span-generation
|
||||
Verify.Graphics.Vty.Span
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -465,7 +466,7 @@ test-suite verify-crop-span-generation
|
||||
Verify.Graphics.Vty.Span
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -497,7 +498,7 @@ test-suite verify-layers-span-generation
|
||||
Verify.Graphics.Vty.Span
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -523,7 +524,7 @@ test-suite verify-utf8-width
|
||||
other-modules: Verify
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
QuickCheck >= 2.4,
|
||||
random == 1.0.*,
|
||||
base >= 4 && < 5,
|
||||
@ -547,7 +548,7 @@ test-suite verify-using-mock-input
|
||||
main-is: VerifyUsingMockInput.hs
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
data-default >= 0.5.3,
|
||||
QuickCheck >= 2.4,
|
||||
smallcheck == 1.*,
|
||||
@ -580,7 +581,7 @@ test-suite verify-config
|
||||
main-is: VerifyConfig.hs
|
||||
|
||||
build-depends: vty,
|
||||
Cabal == 1.18.*,
|
||||
Cabal >= 1.18,
|
||||
data-default >= 0.5.3,
|
||||
HUnit,
|
||||
QuickCheck >= 2.4,
|
||||
|
Loading…
Reference in New Issue
Block a user