@@ -177,6 +177,10 @@ all_tests
177177 , vert_crop_test_1
178178 , vert_crop_test_2
179179 , vert_crop_test_3
180+ , horiz_crop_test_0
181+ , horiz_crop_test_1
182+ , horiz_crop_test_2
183+ , horiz_crop_test_3
180184 ]
181185
182186reserve_output_test = Test
@@ -1030,6 +1034,74 @@ vert_crop_test_3 = Test
10301034 , confirm_results = generic_output_match_confirm
10311035 }
10321036
1037+horiz_crop_test_0 :: Test
1038+horiz_crop_test_0 = Test
1039+ { test_name = "Verify right cropping works as expected with single column chars"
1040+ , test_ID = "crop_test_0"
1041+ , test_action = do
1042+ let base_image = vert_cat $ map (string def_attr) lorum_ipsum
1043+ cropped_image = crop_right (image_width base_image `div` 2) base_image
1044+ image = base_image <-> background_fill 10 2 <-> cropped_image
1045+ output_image_and_wait image
1046+ , print_summary = putStr $ [s|
1047+ 1. Verify the bottom text block is about half the width of the top text block.
1048+ 2. press enter.
1049+ 3. the display should return to the state before the test.
1050+|]
1051+ , confirm_results = generic_output_match_confirm
1052+ }
1053+
1054+horiz_crop_test_1 :: Test
1055+horiz_crop_test_1 = Test
1056+ { test_name = "Verify right cropping works as expected with double column chars"
1057+ , test_ID = "crop_test_0"
1058+ , test_action = do
1059+ let base_image = vert_cat $ map (string def_attr) lorum_ipsum_chinese
1060+ cropped_image = crop_right (image_width base_image `div` 2) base_image
1061+ image = base_image <-> background_fill 10 2 <-> cropped_image
1062+ output_image_and_wait image
1063+ , print_summary = putStr $ [s|
1064+ 1. Verify the bottom text block is the left half of the top block. Ellipses on the right edge are OK.
1065+ 2. press enter.
1066+ 3. the display should return to the state before the test.
1067+|]
1068+ , confirm_results = generic_output_match_confirm
1069+ }
1070+
1071+horiz_crop_test_2 :: Test
1072+horiz_crop_test_2 = Test
1073+ { test_name = "Verify left cropping works as expected with single column chars"
1074+ , test_ID = "crop_test_0"
1075+ , test_action = do
1076+ let base_image = vert_cat $ map (string def_attr) lorum_ipsum
1077+ cropped_image = crop_left (image_width base_image `div` 2) base_image
1078+ image = base_image <-> background_fill 10 2 <-> cropped_image
1079+ output_image_and_wait image
1080+ , print_summary = putStr $ [s|
1081+ 1. Verify the bottom text block is the right half of the top text block.
1082+ 2. press enter.
1083+ 3. the display should return to the state before the test.
1084+|]
1085+ , confirm_results = generic_output_match_confirm
1086+ }
1087+
1088+horiz_crop_test_3 :: Test
1089+horiz_crop_test_3 = Test
1090+ { test_name = "Verify right cropping works as expected with double column chars"
1091+ , test_ID = "crop_test_0"
1092+ , test_action = do
1093+ let base_image = vert_cat $ map (string def_attr) lorum_ipsum_chinese
1094+ cropped_image = crop_left (image_width base_image `div` 2) base_image
1095+ image = base_image <-> background_fill 10 2 <-> cropped_image
1096+ output_image_and_wait image
1097+ , print_summary = putStr $ [s|
1098+ 1. Verify the bottom text block is the right half of the top block. Ellipses on the left edge are OK.
1099+ 2. press enter.
1100+ 3. the display should return to the state before the test.
1101+|]
1102+ , confirm_results = generic_output_match_confirm
1103+ }
1104+
10331105lorum_ipsum :: [String]
10341106lorum_ipsum = lines [s|
10351107Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,
@@ -1047,8 +1119,7 @@ lorum_ipsum_chinese :: [String]
10471119lorum_ipsum_chinese = lines [s|
10481120輐銛 螷蟞覮 裌覅詵 暕 鴅噮 槶 惝掭掝 婸媥媕 耏胠臿, 汫汭沎 忕汌卣 蚡袀 僣 蒮 瀁瀎瀊 渮湸湤 緌翢,
10491121腠腶舝 糲蘥蠩 樏殣氀 蒮 蹢鎒 滍 鸄齴 櫧櫋瀩 鬄鵊鵙 莃荶衒, 毸溠 橀 簎艜薤 莃荶衒 翣聜蒢
1050−
1051−斔櫅檷 晛桼桾 拻敁柧 犿玒 膣, 墐 笓粊紒 樏殣氀 鼀齕, 蔝蓶蓨 顊顃餭 姴怤 骱 暕 蹢鎒鎛 藒襓謥 鄻鎟霣
1122+斔櫅檷 晛桼桾 拻敁柧 犿玒 膣, 墐 笓粊紒 bacon 鼀齕, 蔝蓶蓨 顊顃餭 姴怤 骱 暕 蹢鎒鎛 藒襓謥 鄻鎟霣
10521123鬎鯪, 鐩闤 硻禂稢 谾踘遳 撱 赲迡 箷 蛃袚觙 萇雊蜩 壿嫷 鋡 縢羱聬 跐鉠鉣 蔝蓶蓨 匢奾灱 溮煡煟 雥齆犪
10531124蔰 虈觿, 腷腯葹 鍹餳駷 蛚袲褁 蜸 皯竻 瀁瀎 蜭蜸覟 梪涫湴 揗斝湁 毼
10541125|]