File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module Tests.Regressions
7
7
) where
8
8
9
9
import Control.Exception (SomeException , handle )
10
+ import Data.Char (isLetter )
10
11
import System.IO
11
12
import Test.HUnit (assertBool , assertEqual , assertFailure )
12
13
import qualified Data.ByteString as B
@@ -82,6 +83,12 @@ t197 =
82
83
cond = length fltr
83
84
fltr = filter (== ' ,' ) x
84
85
86
+ t227 :: IO ()
87
+ t227 =
88
+ assertEqual " take (-3) shouldn't crash with overflow"
89
+ (T. length $ T. filter isLetter $ T. take (- 3 ) " Hello! How are you doing today?" )
90
+ 0
91
+
85
92
tests :: F. Test
86
93
tests = F. testGroup " Regressions"
87
94
[ F. testCase " hGetContents_crash" hGetContents_crash
@@ -90,4 +97,5 @@ tests = F.testGroup "Regressions"
90
97
, F. testCase " replicate_crash" replicate_crash
91
98
, F. testCase " utf8_decode_unsafe" utf8_decode_unsafe
92
99
, F. testCase " t197" t197
100
+ , F. testCase " t227" t227
93
101
]
You can’t perform that action at this time.
0 commit comments