on master help sign in
updating tests to compile against 2.1.0.3

Ignore-this: 72681804b946b933b2f8efec031c3a5f darcs-hash:20100711224040-f0a0d-2ada820209967e001e57e445a7abb2408285bb6b.gz

commit0caf0324f9c2184b56050561e0173ba5c8456e99 authorcoreyoconnor <coreyoconnor@gmail.com> dateSun 11 Jul 2010, 15:40 (16 years ago) parenta049776
7 files changed+23−21
test/Makefile+1−1 test/Verify.hs+1 test/Verify/Data/Terminfo/Parse.hs+1−1 test/Verify/Graphics/Vty/Span.hs+7−7 test/verify_debug_terminal.hs+4−4 test/verify_eval_terminfo_caps.hs+6−5 test/verify_parse_terminfo_caps.hs+3−3
test/Makefile+1−1
@@ -26,7 +26,7 @@ $(VERIF_TESTS)
2626$(shell mkdir -p objects )
2727
2828# TODO: Tests should also be buildable referencing the currently installed vty
29−GHC_ARGS=--make -i../src -package parallel -package deepseq-1.1.0.0 -hide-package transformers -hide-package monads-fd -hide-package monads-tf -package QuickCheck-2.1.0.2 -ignore-package vty ../cbits/gwinsz.c ../cbits/output_buffer.c ../cbits/set_term_timing.c ../cbits/mk_wcwidth.c -O -funbox-strict-fields -Wall -threaded -fno-full-laziness -fspec-constr -odir objects -hidir objects
29+GHC_ARGS=--make -i../src -package parallel -package deepseq-1.1.0.0 -hide-package transformers -hide-package monads-fd -hide-package monads-tf -package QuickCheck-2.1.0.3 -ignore-package vty ../cbits/gwinsz.c ../cbits/output_buffer.c ../cbits/set_term_timing.c ../cbits/mk_wcwidth.c -O -funbox-strict-fields -Wall -threaded -fno-full-laziness -fspec-constr -odir objects -hidir objects
3030
3131GHC_PROF_ARGS=-prof -auto-all $(GHC_ARGS)
3232
test/Verify.hs+1
@@ -7,6 +7,7 @@ module Verify ( module Verify
77 , module Test.QuickCheck
88 , succeeded
99 , failed
10+ , result
1011 , Result(..)
1112 , monadicIO
1213 , liftIO
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
114+ else failed $ result
115115 { reason = "out_bytes ["
116116 ++ hex_dump out_bytes
117117 ++ "] /= expected_bytes ["
test/Verify/Graphics/Vty/Span.hs+7−7
@@ -20,10 +20,10 @@ is_attr_span_op _ = False
2020verify_all_spans_have_width i spans w
2121 = case all_spans_have_width spans w of
2222 True -> succeeded
23− False -> failed { reason = "Not all spans contained operations defining exactly "
24− ++ show w
25− ++ " columns of output -\n"
26− ++ show i
27− ++ "\n->\n"
28− ++ show spans
29− }
23+ False -> failed $ result { reason = "Not all spans contained operations defining exactly "
24+ ++ show w
25+ ++ " columns of output -\n"
26+ ++ show i
27+ ++ "\n->\n"
28+ ++ show spans
29+ }
test/verify_debug_terminal.hs+4−4
@@ -50,7 +50,7 @@ single_T_row (DebugWindow w h) = liftIOResult $ do
5050 ++ concat (replicate (fromEnum h - 1) $ "MA" ++ replicate (fromEnum w) 'B')
5151 expected_bytes :: BS.ByteString = UTF8.toRep $ UTF8.fromString expected
5252 if out_bytes /= expected_bytes
53− then return $ failed { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
53+ then return $ failed $ result { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
5454 else return succeeded
5555
5656many_T_rows :: DebugWindow -> Property
@@ -67,7 +67,7 @@ many_T_rows (DebugWindow w h) = liftIOResult $ do
6767 let expected = "HD" ++ concat (replicate (fromEnum h) $ "MA" ++ replicate (fromEnum w) 'T')
6868 expected_bytes :: BS.ByteString = UTF8.toRep $ UTF8.fromString expected
6969 if out_bytes /= expected_bytes
70− then return $ failed { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
70+ then return $ failed $ result { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
7171 else return succeeded
7272
7373many_T_rows_cropped_width :: DebugWindow -> Property
@@ -84,7 +84,7 @@ many_T_rows_cropped_width (DebugWindow w h) = liftIOResult $ do
8484 let expected = "HD" ++ concat (replicate (fromEnum h) $ "MA" ++ replicate (fromEnum w) 'T')
8585 expected_bytes :: BS.ByteString = UTF8.toRep $ UTF8.fromString expected
8686 if out_bytes /= expected_bytes
87− then return $ failed { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
87+ then return $ failed $ result { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
8888 else return succeeded
8989
9090many_T_rows_cropped_height :: DebugWindow -> Property
@@ -101,7 +101,7 @@ many_T_rows_cropped_height (DebugWindow w h) = liftIOResult $ do
101101 let expected = "HD" ++ concat (replicate (fromEnum h) $ "MA" ++ replicate (fromEnum w) 'T')
102102 expected_bytes :: BS.ByteString = UTF8.toRep $ UTF8.fromString expected
103103 if out_bytes /= expected_bytes
104− then return $ failed { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
104+ then return $ failed $ result { reason = "\n" ++ show out_bytes ++ "\n\n" ++ show expected_bytes }
105105 else return succeeded
106106
107107main = run_test $ do
test/verify_eval_terminfo_caps.hs+6−5
@@ -104,7 +104,8 @@ main = do
104104 parse_result <- parse_cap_expression cap_def
105105 let test_name = "\teval cap " ++ cap_name ++ " -> " ++ show cap_def
106106 _ <- case parse_result of
107− Left error -> verify test_name ( liftResult $ failed { reason = "prase error " ++ show error } )
107+ Left error -> verify test_name ( liftResult $ failed
108+ $ result { reason = "prase error " ++ show error } )
108109 Right !cap_expr -> verify test_name ( verify_eval_cap eval_buffer cap_expr )
109110 return ()
110111 Nothing -> do
@@ -123,11 +124,11 @@ verify_eval_cap eval_buffer expr !junk_int = do
123124 end_ptr <- serialize_cap_expression expr input_values start_ptr
124125 case end_ptr `minusPtr` start_ptr of
125126 count | count < 0 ->
126− return $ failed { reason = "End pointer before start pointer." }
127+ return $ failed $ result { reason = "End pointer before start pointer." }
127128 | toEnum count > byte_count ->
128− return $ failed { reason = "End pointer past end of buffer by "
129− ++ show (toEnum count - byte_count)
130− }
129+ return $ failed $ result { reason = "End pointer past end of buffer by "
130+ ++ show (toEnum count - byte_count)
131+ }
131132 | otherwise ->
132133 return succeeded
133134
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 { reason = "parse error " ++ show error }
114+ Left error -> return $ failed $ result { 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 { reason = "out param count /= expected param count" }
143+ else failed $ result { 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 { reason = "out param count /= expected param count" }
152+ else failed $ result { reason = "out param count /= expected param count" }
153153
154154print_cap ti cap_name = do
155155 putStrLn $ cap_name ++ ": " ++ show (from_capname ti cap_name)