Skip to content

Commit fbfc1b4

Browse files
LysxiaBodigrim
authored andcommitted
Add regression test for #648
1 parent eeeb893 commit fbfc1b4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Tests/Regressions.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,17 @@ t633 =
202202
_ <- evaluate (stimes (maxBound :: Word) "a" :: T.Text)
203203
assertFailure "should fail"
204204

205+
t648 :: IO ()
206+
t648 = withTempFile $ \_ h -> do
207+
hSetEncoding h utf8
208+
hSetNewlineMode h (NewlineMode LF CRLF)
209+
hSetBuffering h (BlockBuffering $ Just 4)
210+
let line = T.replicate 2047 "_"
211+
T.hPutStrLn h line
212+
hSeek h AbsoluteSeek 0
213+
line' <- T.hGetLine h
214+
T.append line "\r" @?= line'
215+
205216
tests :: F.TestTree
206217
tests = F.testGroup "Regressions"
207218
[ F.testCase "hGetContents_crash" hGetContents_crash
@@ -221,4 +232,5 @@ tests = F.testGroup "Regressions"
221232
, F.testCase "t529" t529
222233
, F.testCase "t559" t559
223234
, F.testCase "t633" t633
235+
, F.testCase "t648" t648
224236
]

0 commit comments

Comments
 (0)