diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-12-09 14:41:17 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-10 19:58:19 -0500 |
commit | 8dd9929ad29fd200405d068463af64dafff6b402 (patch) | |
tree | 0451c85dbec8e3b30b861d9a82bdb7ef0f0e5b2b /libraries/base/tests | |
parent | 7a823b0ffcbd5b5c4c03334e72c8a36460b62ff7 (diff) | |
download | haskell-8dd9929ad29fd200405d068463af64dafff6b402.tar.gz |
testsuite: Add (broken) test for #17510
Diffstat (limited to 'libraries/base/tests')
-rw-r--r-- | libraries/base/tests/IO/T17510.hs | 15 | ||||
-rw-r--r-- | libraries/base/tests/IO/T17510.stdout | 4 | ||||
-rw-r--r-- | libraries/base/tests/IO/all.T | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/libraries/base/tests/IO/T17510.hs b/libraries/base/tests/IO/T17510.hs new file mode 100644 index 0000000000..a291855a42 --- /dev/null +++ b/libraries/base/tests/IO/T17510.hs @@ -0,0 +1,15 @@ +-- | Test that a handle from 'hDuplicate' really shares the file position with +-- its parent. + +import System.IO +import GHC.IO.Handle + +main :: IO () +main = do + writeFile "test" "hello\nworld\ntesting\n" + h <- openFile "test" ReadMode + h2 <- hDuplicate h + hGetLine h >>= putStrLn -- should print "hello" + hGetLine h2 >>= putStrLn -- should print "world" + hGetLine h >>= putStrLn -- should print "testing" + diff --git a/libraries/base/tests/IO/T17510.stdout b/libraries/base/tests/IO/T17510.stdout new file mode 100644 index 0000000000..23e60981b1 --- /dev/null +++ b/libraries/base/tests/IO/T17510.stdout @@ -0,0 +1,4 @@ +hello +world +testing + diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T index bfc6a090e9..189fbebb88 100644 --- a/libraries/base/tests/IO/all.T +++ b/libraries/base/tests/IO/all.T @@ -142,3 +142,4 @@ test('T17414', when(opsys('linux'), skip), high_memory_usage], compile_and_run, ['']) +test('T17510', expect_broken(17510), compile_and_run, ['']) |