on master help sign in
fixup examples that use outputForCurrentTerminal
2c756c1Corey O'Connor
test/interactive_terminal_test.hs+18−18
@@ -77,7 +77,7 @@ with the test_results.list file pasted into the issue. A suitable summary is:
77 ( \ (_ :: SomeException) -> return (envName, "") )
77 ( \ (_ :: SomeException) -> return (envName, "") )
78 )
78 )
79 [ "TERM", "COLORTERM", "LANG", "TERM_PROGRAM", "XTERM_VERSION" ]
79 [ "TERM", "COLORTERM", "LANG", "TERM_PROGRAM", "XTERM_VERSION" ]
80− t <- outputForCurrentTerminal
80+ t <- outputForCurrentTerminal def
81 let resultsTxt = show envAttributes ++ "\n"
81 let resultsTxt = show envAttributes ++ "\n"
82 ++ terminalID t ++ "\n"
82 ++ terminalID t ++ "\n"
83 ++ show results ++ "\n"
83 ++ show results ++ "\n"
@@ -188,7 +188,7 @@ reserveOutputTest = Test
188 { testName = "Initialize and reserve terminal output then restore previous state."
188 { testName = "Initialize and reserve terminal output then restore previous state."
189 , testID = "reserveOutputTest"
189 , testID = "reserveOutputTest"
190 , testAction = do
190 , testAction = do
191− t <- outputForCurrentTerminal
191+ t <- outputForCurrentTerminal def
192 reserveDisplay t
192 reserveDisplay t
193 putStrLn "Line 1"
193 putStrLn "Line 1"
194 putStrLn "Line 2"
194 putStrLn "Line 2"
@@ -221,7 +221,7 @@ displayBoundsTest0 = Test
221 { testName = "Verify display bounds are correct test 0: Using spaces."
221 { testName = "Verify display bounds are correct test 0: Using spaces."
222 , testID = "displayBoundsTest0"
222 , testID = "displayBoundsTest0"
223 , testAction = do
223 , testAction = do
224− t <- outputForCurrentTerminal
224+ t <- outputForCurrentTerminal def
225 reserveDisplay t
225 reserveDisplay t
226 (w,h) <- displayBounds t
226 (w,h) <- displayBounds t
227 let row0 = replicate (fromEnum w) 'X' ++ "\n"
227 let row0 = replicate (fromEnum w) 'X' ++ "\n"
@@ -242,7 +242,7 @@ displayBoundsTest1 = Test
242 { testName = "Verify display bounds are correct test 0: Using cursor movement."
242 { testName = "Verify display bounds are correct test 0: Using cursor movement."
243 , testID = "displayBoundsTest1"
243 , testID = "displayBoundsTest1"
244 , testAction = do
244 , testAction = do
245− t <- outputForCurrentTerminal
245+ t <- outputForCurrentTerminal def
246 reserveDisplay t
246 reserveDisplay t
247 (w,h) <- displayBounds t
247 (w,h) <- displayBounds t
248 setCursorPos t 0 0
248 setCursorPos t 0 0
@@ -271,7 +271,7 @@ displayBoundsTest2 = Test
271 { testName = "Verify display bounds are correct test 0: Using Image ops."
271 { testName = "Verify display bounds are correct test 0: Using Image ops."
272 , testID = "displayBoundsTest2"
272 , testID = "displayBoundsTest2"
273 , testAction = do
273 , testAction = do
274− t <- outputForCurrentTerminal
274+ t <- outputForCurrentTerminal def
275 reserveDisplay t
275 reserveDisplay t
276 bounds@(w,h) <- displayBounds t
276 bounds@(w,h) <- displayBounds t
277 let firstRow = horizCat $ replicate (fromEnum w) (char defAttr 'X')
277 let firstRow = horizCat $ replicate (fromEnum w) (char defAttr 'X')
@@ -294,7 +294,7 @@ displayBoundsTest3 = Test
294 { testName = "Verify display bounds are correct test 0: Hide cursor; Set cursor pos."
294 { testName = "Verify display bounds are correct test 0: Hide cursor; Set cursor pos."
295 , testID = "displayBoundsTest3"
295 , testID = "displayBoundsTest3"
296 , testAction = do
296 , testAction = do
297− t <- outputForCurrentTerminal
297+ t <- outputForCurrentTerminal def
298 reserveDisplay t
298 reserveDisplay t
299 (w,h) <- displayBounds t
299 (w,h) <- displayBounds t
300 hideCursor t
300 hideCursor t
@@ -406,7 +406,7 @@ unicodeSingleWidth0 = Test
406 { testName = "Verify terminal can display unicode single-width characters. (Direct UTF-8)"
406 { testName = "Verify terminal can display unicode single-width characters. (Direct UTF-8)"
407 , testID = "unicodeSingleWidth0"
407 , testID = "unicodeSingleWidth0"
408 , testAction = do
408 , testAction = do
409− t <- outputForCurrentTerminal
409+ t <- outputForCurrentTerminal def
410 reserveDisplay t
410 reserveDisplay t
411 hideCursor t
411 hideCursor t
412 withArrayLen (concat utf8Txt0) (flip $ hPutBuf stdout)
412 withArrayLen (concat utf8Txt0) (flip $ hPutBuf stdout)
@@ -425,7 +425,7 @@ unicodeSingleWidth1 = Test
425 { testName = "Verify terminal can display unicode single-width characters. (Image ops)"
425 { testName = "Verify terminal can display unicode single-width characters. (Image ops)"
426 , testID = "unicodeSingleWidth1"
426 , testID = "unicodeSingleWidth1"
427 , testAction = do
427 , testAction = do
428− t <- outputForCurrentTerminal
428+ t <- outputForCurrentTerminal def
429 reserveDisplay t
429 reserveDisplay t
430 let pic = picForImage image
430 let pic = picForImage image
431 image = line0 <-> line1
431 image = line0 <-> line1
@@ -488,7 +488,7 @@ unicodeDoubleWidth0 = Test
488 { testName = "Verify terminal can display unicode double-width characters. (Direct UTF-8)"
488 { testName = "Verify terminal can display unicode double-width characters. (Direct UTF-8)"
489 , testID = "unicodeDoubleWidth0"
489 , testID = "unicodeDoubleWidth0"
490 , testAction = do
490 , testAction = do
491− t <- outputForCurrentTerminal
491+ t <- outputForCurrentTerminal def
492 reserveDisplay t
492 reserveDisplay t
493 hideCursor t
493 hideCursor t
494 withArrayLen (concat utf8Txt1) (flip $ hPutBuf stdout)
494 withArrayLen (concat utf8Txt1) (flip $ hPutBuf stdout)
@@ -507,7 +507,7 @@ unicodeDoubleWidth1 = Test
507 { testName = "Verify terminal can display unicode double-width characters. (Image ops)"
507 { testName = "Verify terminal can display unicode double-width characters. (Image ops)"
508 , testID = "unicodeDoubleWidth1"
508 , testID = "unicodeDoubleWidth1"
509 , testAction = do
509 , testAction = do
510− t <- outputForCurrentTerminal
510+ t <- outputForCurrentTerminal def
511 reserveDisplay t
511 reserveDisplay t
512 let pic = picForImage image
512 let pic = picForImage image
513 image = line0 <-> line1
513 image = line0 <-> line1
@@ -561,7 +561,7 @@ attributesTest0 = Test
561 { testName = "Character attributes: foreground colors."
561 { testName = "Character attributes: foreground colors."
562 , testID = "attributesTest0"
562 , testID = "attributesTest0"
563 , testAction = do
563 , testAction = do
564− t <- outputForCurrentTerminal
564+ t <- outputForCurrentTerminal def
565 reserveDisplay t
565 reserveDisplay t
566 let pic = picForImage image
566 let pic = picForImage image
567 image = border <|> column0 <|> border <|> column1 <|> border
567 image = border <|> column0 <|> border <|> column1 <|> border
@@ -607,7 +607,7 @@ attributesTest1 = Test
607 { testName = "Character attributes: background colors."
607 { testName = "Character attributes: background colors."
608 , testID = "attributesTest1"
608 , testID = "attributesTest1"
609 , testAction = do
609 , testAction = do
610− t <- outputForCurrentTerminal
610+ t <- outputForCurrentTerminal def
611 reserveDisplay t
611 reserveDisplay t
612 let pic = picForImage image
612 let pic = picForImage image
613 image = border <|> column0 <|> border <|> column1 <|> border
613 image = border <|> column0 <|> border <|> column1 <|> border
@@ -662,7 +662,7 @@ attributesTest2 = Test
662 { testName = "Character attributes: Vivid foreground colors."
662 { testName = "Character attributes: Vivid foreground colors."
663 , testID = "attributesTest2"
663 , testID = "attributesTest2"
664 , testAction = do
664 , testAction = do
665− t <- outputForCurrentTerminal
665+ t <- outputForCurrentTerminal def
666 reserveDisplay t
666 reserveDisplay t
667 let pic = picForImage image
667 let pic = picForImage image
668 image = horizCat [border, column0, border, column1, border, column2, border]
668 image = horizCat [border, column0, border, column1, border, column2, border]
@@ -721,7 +721,7 @@ attributesTest3 = Test
721 { testName = "Character attributes: Vivid background colors."
721 { testName = "Character attributes: Vivid background colors."
722 , testID = "attributesTest3"
722 , testID = "attributesTest3"
723 , testAction = do
723 , testAction = do
724− t <- outputForCurrentTerminal
724+ t <- outputForCurrentTerminal def
725 reserveDisplay t
725 reserveDisplay t
726 let pic = picForImage image
726 let pic = picForImage image
727 image = horizCat [border, column0, border, column1, border, column2, border]
727 image = horizCat [border, column0, border, column1, border, column2, border]
@@ -799,7 +799,7 @@ attributesTest4 = Test
799 { testName = "Character attributes: Bold; Blink; Underline."
799 { testName = "Character attributes: Bold; Blink; Underline."
800 , testID = "attributesTest4"
800 , testID = "attributesTest4"
801 , testAction = do
801 , testAction = do
802− t <- outputForCurrentTerminal
802+ t <- outputForCurrentTerminal def
803 reserveDisplay t
803 reserveDisplay t
804 let pic = picForImage image
804 let pic = picForImage image
805 image = horizCat [border, column0, border, column1, border]
805 image = horizCat [border, column0, border, column1, border]
@@ -851,7 +851,7 @@ attributesTest5 = Test
851 { testName = "Character attributes: 240 color palette"
851 { testName = "Character attributes: 240 color palette"
852 , testID = "attributesTest5"
852 , testID = "attributesTest5"
853 , testAction = do
853 , testAction = do
854− t <- outputForCurrentTerminal
854+ t <- outputForCurrentTerminal def
855 reserveDisplay t
855 reserveDisplay t
856 let pic = picForImage image
856 let pic = picForImage image
857 image = vertCat $ map horizCat $ splitColorImages colorImages
857 image = vertCat $ map horizCat $ splitColorImages colorImages
@@ -962,7 +962,7 @@ outputImageAndWait image = do
962
962
963outputPicAndWait :: Picture -> IO ()
963outputPicAndWait :: Picture -> IO ()
964outputPicAndWait pic = do
964outputPicAndWait pic = do
965− t <- outputForCurrentTerminal
965+ t <- outputForCurrentTerminal def
966 reserveDisplay t
966 reserveDisplay t
967 d <- displayBounds t >>= displayContext t
967 d <- displayBounds t >>= displayContext t
968 outputPicture d pic
968 outputPicture d pic
@@ -1145,7 +1145,7 @@ layer1 = Test
1145
1145
1146cheesyAnim0 :: Image -> [Image] -> IO ()
1146cheesyAnim0 :: Image -> [Image] -> IO ()
1147cheesyAnim0 i background = do
1147cheesyAnim0 i background = do
1148− t <- outputForCurrentTerminal
1148+ t <- outputForCurrentTerminal def
1149 reserveDisplay t
1149 reserveDisplay t
1150 bounds <- displayBounds t
1150 bounds <- displayBounds t
1151 d <- displayContext t bounds
1151 d <- displayContext t bounds