@@ -9,6 +9,7 @@ import Graphics.Vty.Picture
9import Graphics.Vty.Terminal
9import Graphics.Vty.Terminal
10import Graphics.Vty.DisplayRegion
10import Graphics.Vty.DisplayRegion
12+import Control.Concurrent (threadDelay)
12import Control.Exception
13import Control.Exception
13import Control.Monad
14import Control.Monad
@@ -182,6 +183,7 @@ all_tests
182 , horiz_crop_test_2
183 , horiz_crop_test_2
183 , horiz_crop_test_3
184 , horiz_crop_test_3
184 , layer_0
185 , layer_0
187reserve_output_test = Test
189reserve_output_test = Test
@@ -1117,10 +1119,48 @@ layer_0 = Test
1117 p = pic_for_layers [upper_image, lower_image]
1119 p = pic_for_layers [upper_image, lower_image]
1118 output_pic_and_wait p
1120 output_pic_and_wait p
1119 , print_summary = putStr $ [s|
1121 , print_summary = putStr $ [s|
1122+ 1. Verify the text block appears to be Chinese text placed on top Latin text.
1124+ 3. the display should return to the state before the test.
1121 , confirm_results = generic_output_match_confirm
1126 , confirm_results = generic_output_match_confirm
1131+ { test_name = "verify layer 1"
1132+ , test_ID = "layer_1"
1134+ let upper_image = vert_cat $ map (string def_attr) lorum_ipsum_chinese
1135+ block = resize 10 10 upper_image
1136+ layer_0 = vert_cat $ map (string def_attr) lorum_ipsum
1137+ layer_1 = char_fill (def_attr `with_back_color` blue) '#' 1000 1000
1138+ cheesy_anim_0 block [layer_0, layer_1]
1139+ , print_summary = putStr $ [s|
1140+ 1. Verify the text block appears to be Chinese text moving on top a Latin text.
1141+ Which is all on a background of '#' characters over blue.
1143+ 3. the display should return to the state before the test.
1145+ , confirm_results = generic_output_match_confirm
1148+cheesy_anim_0 :: Image -> [Image] -> IO ()
1149+cheesy_anim_0 i background = do
1150+ t <- current_terminal
1152+ bounds <- display_bounds t
1153+ d <- display_context t bounds
1154+ forM_ [0..100] $ \t -> do
1155+ let i_offset = translate (t `mod` region_width bounds)
1156+ (t `div` 2 `mod` region_height bounds)
1158+ let pic = pic_for_layers $ i_offset : background
1159+ output_picture d pic
1125lorum_ipsum :: [String]
1165lorum_ipsum :: [String]
1126lorum_ipsum = lines [s|
1166lorum_ipsum = lines [s|