on master help sign in
Update the expected output from the mock terminal.
66c045fCorey O'Connor
test/Verify/Graphics/Vty/Output.hs+4−5
@@ -49,12 +49,11 @@ terminalsOfInterest =
49
49
50compareMockOutput :: MockData -> String -> IO Result
50compareMockOutput :: MockData -> String -> IO Result
51compareMockOutput mockData expectedStr = do
51compareMockOutput mockData expectedStr = do
52− outBytes <- readIORef mockData >>= return . UTF8.toRep
52+ outStr <- UTF8.toString <$> readIORef mockData
53− let expectedBytes :: BS.ByteString = UTF8.toRep $ UTF8.fromString expectedStr
53+ if outStr /= expectedStr
54− if outBytes /= expectedBytes
55− then return $ failed { reason = "bytes\n" ++ show outBytes
54+ then return $ failed { reason = "bytes\n" ++ outStr
56 ++ "\nare not the expected bytes\n"
55 ++ "\nare not the expected bytes\n"
57− ++ show expectedBytes
56+ ++ expectedStr
58 }
57 }
59 else return succeeded
58 else return succeeded
60
59
test/VerifyUsingMockTerminal.hs+5−5
@@ -46,8 +46,8 @@ singleTRow (MockWindow w h) = liftIOResult $ do
46 -- The mock output string that represents the output bytes a single line containing the T
46 -- The mock output string that represents the output bytes a single line containing the T
47 -- string: Followed by h - 1 lines of a change to the background attribute and then the
47 -- string: Followed by h - 1 lines of a change to the background attribute and then the
48 -- background character
48 -- background character
49− let expected = "HD" ++ "MA" ++ replicate (fromEnum w) 'T'
49+ let expected = "H" ++ "MDA" ++ replicate (fromEnum w) 'T'
50− ++ concat (replicate (fromEnum h - 1) $ "MA" ++ replicate (fromEnum w) 'B')
50+ ++ concat (replicate (fromEnum h - 1) $ "MDA" ++ replicate (fromEnum w) 'B')
51 compareMockOutput mockData expected
51 compareMockOutput mockData expected
52
52
53manyTRows :: MockWindow -> Property
53manyTRows :: MockWindow -> Property
@@ -60,7 +60,7 @@ manyTRows (MockWindow w h) = liftIOResult $ do
60 outputPicture dc pic
60 outputPicture dc pic
61 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
61 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
62 -- attribute change. 'A', followed by w 'T's
62 -- 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')
64 compareMockOutput mockData expected
64 compareMockOutput mockData expected
65
65
66manyTRowsCroppedWidth :: MockWindow -> Property
66manyTRowsCroppedWidth :: MockWindow -> Property
@@ -73,7 +73,7 @@ manyTRowsCroppedWidth (MockWindow w h) = liftIOResult $ do
73 outputPicture dc pic
73 outputPicture dc pic
74 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
74 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
75 -- attribute change. 'A', followed by w 'T's
75 -- 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')
77 compareMockOutput mockData expected
77 compareMockOutput mockData expected
78
78
79manyTRowsCroppedHeight :: MockWindow -> Property
79manyTRowsCroppedHeight :: MockWindow -> Property
@@ -86,7 +86,7 @@ manyTRowsCroppedHeight (MockWindow w h) = liftIOResult $ do
86 outputPicture dc pic
86 outputPicture dc pic
87 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
87 -- The UTF8 string that represents the output bytes is h repeats of a move, 'M', followed by an
88 -- attribute change. 'A', followed by w count 'T's
88 -- 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')
90 compareMockOutput mockData expected
90 compareMockOutput mockData expected
91
91
92tests :: IO [Test]
92tests :: IO [Test]