From 3b8b96b38b512d900365f91403e138c6e229df7c Mon Sep 17 00:00:00 2001 From: sof Date: Tue, 2 Nov 1999 11:25:42 +0000 Subject: [PATCH] [project @ 1999-11-02 11:25:42 by sof] updated with expected-output files --- ghc/tests/lib/should_run/io001.hs | 1 + ghc/tests/lib/should_run/io001.stdout | 50 +++++++++++++++++++++++++++++ ghc/tests/lib/should_run/io002.hs | 5 +-- ghc/tests/lib/should_run/io002.stdout | 2 ++ ghc/tests/lib/should_run/ioexts001.hs | 2 +- ghc/tests/lib/should_run/ioexts001.stdout | 1 + 6 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 ghc/tests/lib/should_run/io001.stdout create mode 100644 ghc/tests/lib/should_run/io002.stdout create mode 100644 ghc/tests/lib/should_run/ioexts001.stdout diff --git a/ghc/tests/lib/should_run/io001.hs b/ghc/tests/lib/should_run/io001.hs index 9606a2c..ec16fda 100644 --- a/ghc/tests/lib/should_run/io001.hs +++ b/ghc/tests/lib/should_run/io001.hs @@ -64,6 +64,7 @@ main = do hClose h putStrLn "\nUsing hSeek/SeekFromEnd: " + putStrLn "(Don't worry if you're seeing differing numbers here, it might be down to '\\n' vs '\\r\\n')" h <- openFile "io001.hs" ReadMode recordDoAndRepos3 h $ recordDoAndRepos3 h $ diff --git a/ghc/tests/lib/should_run/io001.stdout b/ghc/tests/lib/should_run/io001.stdout new file mode 100644 index 0000000..0726d26 --- /dev/null +++ b/ghc/tests/lib/should_run/io001.stdout @@ -0,0 +1,50 @@ +At position: 0, found: '-' +At position: 1, found: '-' +At position: 2, found: ' ' +At position: 3, found: '!' +At position: 4, found: '!' + +At position: 4, found: '!' +At position: 3, found: '!' +At position: 2, found: ' ' +At position: 1, found: '-' +At position: 0, found: '-' + +At position: 0, found: '-' +At position: 1, found: '-' +At position: 2, found: ' ' +At position: 3, found: '!' +At position: 4, found: '!' + +At position: 4, found: '!' +At position: 3, found: '!' +At position: 2, found: ' ' +At position: 1, found: '-' +At position: 0, found: '-' + +Using hSeek/AbsoluteSeek: +At position: 0, found: '-' +At position: 1, found: '-' +At position: 2, found: ' ' +At position: 3, found: '!' +At position: 4, found: '!' + +At position: 4, found: '!' +At position: 3, found: '!' +At position: 2, found: ' ' +At position: 1, found: '-' +At position: 0, found: '-' + +Using hSeek/SeekFromEnd: +(Don't worry if you're seeing differing numbers here, it might be down to '\n' vs '\r\n') +At position: 0, found: '-' +At position: 1, found: '-' +At position: 2, found: ' ' +At position: 3, found: '!' +At position: 4, found: '!' + +At position: 1740, found: ' ' +At position: 1741, found: '"' +At position: 1742, found: '"' +At position: 1743, found: '\n' +At position: 1743, found: '\n' diff --git a/ghc/tests/lib/should_run/io002.hs b/ghc/tests/lib/should_run/io002.hs index 17d8639..0bb0cac 100644 --- a/ghc/tests/lib/should_run/io002.hs +++ b/ghc/tests/lib/should_run/io002.hs @@ -8,17 +8,18 @@ import Directory main :: IO () main = do h <- openFile "tst-seek" WriteMode - hPutStrLn h "test string1" + hPutStr h "test string1" -- seek to EOF should be cool.. hSeek h SeekFromEnd 0 hPutStr h "test string2" - -- seek past EOF should now be cool.. + -- seek past EOF should now also be cool.. hSeek h SeekFromEnd 3 hPutStr h "test string3" hSeek h AbsoluteSeek 13 hPutStr h "test string4" x <- hTell h print x + hPutStr h "filler" hClose h ls <- readFile "tst-seek" putStrLn ls diff --git a/ghc/tests/lib/should_run/io002.stdout b/ghc/tests/lib/should_run/io002.stdout new file mode 100644 index 0000000..da4db70 --- /dev/null +++ b/ghc/tests/lib/should_run/io002.stdout @@ -0,0 +1,2 @@ +25 +test string1ttest string4filler string3 diff --git a/ghc/tests/lib/should_run/ioexts001.hs b/ghc/tests/lib/should_run/ioexts001.hs index 4f1d9b5..b7f87a4 100644 --- a/ghc/tests/lib/should_run/ioexts001.hs +++ b/ghc/tests/lib/should_run/ioexts001.hs @@ -7,6 +7,6 @@ import IOExts loop r 0 = return () loop r c = loop r (c-1) >> writeIORef r 42 -main = newIORef 0 >>= \r -> loop r 1000000 +main = newIORef 0 >>= \r -> loop r 1000000 >> putStrLn "done" diff --git a/ghc/tests/lib/should_run/ioexts001.stdout b/ghc/tests/lib/should_run/ioexts001.stdout new file mode 100644 index 0000000..19f86f4 --- /dev/null +++ b/ghc/tests/lib/should_run/ioexts001.stdout @@ -0,0 +1 @@ +done -- 1.7.10.4