on master help sign in
-
commit05b27000d7ad39c5dd5f943c21ccad49f6bf96de authorCorey O'Connor <coreyoconnor@gmail.com> dateMon 4 Jul 2011, 00:04 (15 years ago) parente59ce7f
5 files changed+10−8
src/Graphics/Vty/Debug.hs−1 src/Graphics/Vty/Span.hs+4−2 test/Makefile+2−1 test/Verify/Data/Terminfo/Parse.hs+1−1 test/verify_parse_terminfo_caps.hs+3−3
src/Graphics/Vty/Debug.hs−1
@@ -7,7 +7,6 @@ where
77
88import Graphics.Vty.Attributes
99import Graphics.Vty.Debug.Image
10−import Graphics.Vty.Picture
1110import Graphics.Vty.Span
1211import Graphics.Vty.DisplayRegion
1312
src/Graphics/Vty/Span.hs+4−2
@@ -230,14 +230,16 @@ snoc_text_span a text_str mrow_ops skip_col y remaining_columns = do
230230 then if ow' == remaining_columns
231231 then ( ow', dw', char_count', b0 )
232232 else if (w + ow') > remaining_columns
233− then ( remaining_columns, dw', char_count' + ooverflow, B.append b0 $ B.pack $ encode $ genericReplicate ooverflow '…' )
233+ then ( remaining_columns, dw', char_count' + ooverflow, B.append b0 oelipses )
234234 else ( ow' + w, dw', char_count' + 1, B.append b0 $ B.pack $ encode [c] )
235235 else if (w + dw') > skip_col
236− then ( doverflow, skip_col, doverflow, B.append b0 $ B.pack $ encode $ genericReplicate doverflow '…' )
236+ then ( doverflow, skip_col, doverflow, B.append b0 delipses )
237237 else ( ow', w + dw', char_count', b0 )
238238 where
239239 doverflow = skip_col - dw'
240+ delipses = B.pack $ encode $ genericReplicate doverflow '…'
240241 ooverflow = remaining_columns - ow'
242+ oelipses = B.pack $ encode $ genericReplicate ooverflow '…'
241243
242244snoc_bg_fill :: MRowOps s -> Background -> Word -> Word -> ST s ()
243245snoc_bg_fill _row_ops _bg 0 _row
test/Makefile+2−1
@@ -35,7 +35,8 @@ GHC_ARGS=--make -i../src \
3535 -package QuickCheck-2.4 \
3636 -ignore-package vty \
3737 ../cbits/gwinsz.c ../cbits/set_term_timing.c ../cbits/mk_wcwidth.c \
38− -O -funbox-strict-fields -Wall -threaded -fno-full-laziness -fspec-constr -rtsopts \
38+ -O -funbox-strict-fields -Wall -threaded -fno-full-laziness -fspec-constr -fspec-constr-count=10 \
39+ -rtsopts \
3940 -odir objects -hidir objects
4041
4142GHC_PROF_ARGS=-prof -auto-all $(GHC_ARGS)
test/Verify/Data/Terminfo/Parse.hs+1−1
@@ -111,7 +111,7 @@ verify_bytes_equal :: [Word8] -> [Word8] -> Result
111111verify_bytes_equal out_bytes expected_bytes
112112 = if out_bytes == expected_bytes
113113 then succeeded
114− else failed $ result
114+ else failed
115115 { reason = "out_bytes ["
116116 ++ hex_dump out_bytes
117117 ++ "] /= expected_bytes ["
test/verify_parse_terminfo_caps.hs+3−3
@@ -111,7 +111,7 @@ main = do
111111verify_parse_cap cap_string on_parse = liftIOResult $ do
112112 parse_result <- parse_cap_expression cap_string
113113 case parse_result of
114− Left error -> return $ failed $ result { reason = "parse error " ++ show error }
114+ Left error -> return $ failed { reason = "parse error " ++ show error }
115115 Right e -> on_parse e
116116
117117non_paramaterized_caps (NonParamCapString cap) = do
@@ -140,7 +140,7 @@ push_param_caps (PushParamCap cap_string expected_param_count expected_bytes) =
140140 out_param_count = param_count e
141141 in return $ if out_param_count == expected_param_count
142142 then verify_bytes_equal out_bytes expected_bytes
143− else failed $ result { reason = "out param count /= expected param count" }
143+ else failed { reason = "out param count /= expected param count" }
144144
145145dec_print_param_caps (DecPrintCap cap_string expected_param_count expected_bytes) = do
146146 verify_parse_cap cap_string $ \e ->
@@ -149,7 +149,7 @@ dec_print_param_caps (DecPrintCap cap_string expected_param_count expected_bytes
149149 out_param_count = param_count e
150150 in return $ if out_param_count == expected_param_count
151151 then verify_bytes_equal out_bytes expected_bytes
152− else failed $ result { reason = "out param count /= expected param count" }
152+ else failed { reason = "out param count /= expected param count" }
153153
154154print_cap ti cap_name = do
155155 putStrLn $ cap_name ++ ": " ++ show (from_capname ti cap_name)