on master help sign in
Update the expected output from the mock terminal.
commit66c045fca3a33f227df56b9a7b7f905e48c6ff0d authorCorey O'Connor <coreyoconnor@gmail.com> dateSat 8 Aug 2015, 22:22 (11 years ago) parent7d0e00b
2 files changed+9−10
test/Verify/Graphics/Vty/Output.hs+4−5 test/VerifyUsingMockTerminal.hs+5−5
test/Verify/Graphics/Vty/Output.hs+4−5
@@ -49,12 +49,11 @@ terminalsOfInterest =
4949
5050compareMockOutput :: MockData -> String -> IO Result
5151compareMockOutput mockData expectedStr = do
52− outBytes <- readIORef mockData >>= return . UTF8.toRep
53− let expectedBytes :: BS.ByteString = UTF8.toRep $ UTF8.fromString expectedStr
54− if outBytes /= expectedBytes
55− then return $ failed { reason = "bytes\n" ++ show outBytes
52+ outStr <- UTF8.toString <$> readIORef mockData
53+ if outStr /= expectedStr
54+ then return $ failed { reason = "bytes\n" ++ outStr
5655 ++ "\nare not the expected bytes\n"
57− ++ show expectedBytes
56+ ++ expectedStr
5857 }
5958 else return succeeded
6059
test/VerifyUsingMockTerminal.hs+5−5
@@ -46,8 +46,8 @@ singleTRow (MockWindow w h) = liftIOResult $ do
4646 -- The mock output string that represents the output bytes a single line containing the T
4747 -- string: Followed by h - 1 lines of a change to the background attribute and then the
4848 -- background character
49− let expected = "HD" ++ "MA" ++ replicate (fromEnum w) 'T'
50− ++ concat (replicate (fromEnum h - 1) $ "MA" ++ replicate (fromEnum w) 'B')
49+ let expected = "H" ++ "MDA" ++ replicate (fromEnum w) 'T'
50+ ++ concat (replicate (fromEnum h - 1) $ "MDA" ++ replicate (fromEnum w) 'B')
5151 compareMockOutput mockData expected
5252
5353manyTRows :: MockWindow -> Property
@@ -60,7 +60,7 @@ manyTRows (MockWindow w h) = liftIOResult $ do
6060 outputPicture dc pic
6161 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
6262 -- attribute change. 'A', followed by w 'T's
63− let expected = "HD" ++ concat (replicate (fromEnum h) $ "MA" ++ replicate (fromEnum w) 'T')
63+ let expected = "H" ++ concat (replicate (fromEnum h) $ "MDA" ++ replicate (fromEnum w) 'T')
6464 compareMockOutput mockData expected
6565
6666manyTRowsCroppedWidth :: MockWindow -> Property
@@ -73,7 +73,7 @@ manyTRowsCroppedWidth (MockWindow w h) = liftIOResult $ do
7373 outputPicture dc pic
7474 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
7575 -- attribute change. 'A', followed by w 'T's
76− let expected = "HD" ++ concat (replicate (fromEnum h) $ "MA" ++ replicate (fromEnum w) 'T')
76+ let expected = "H" ++ concat (replicate (fromEnum h) $ "MDA" ++ replicate (fromEnum w) 'T')
7777 compareMockOutput mockData expected
7878
7979manyTRowsCroppedHeight :: MockWindow -> Property
@@ -86,7 +86,7 @@ manyTRowsCroppedHeight (MockWindow w h) = liftIOResult $ do
8686 outputPicture dc pic
8787 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
8888 -- attribute change. 'A', followed by w count 'T's
89− let expected = "HD" ++ concat (replicate (fromEnum h) $ "MA" ++ replicate (fromEnum w) 'T')
89+ let expected = "H" ++ concat (replicate (fromEnum h) $ "MDA" ++ replicate (fromEnum w) 'T')
9090 compareMockOutput mockData expected
9191
9292tests :: IO [Test]