[project @ 1999-11-02 11:25:42 by sof]
authorsof <unknown>
Tue, 2 Nov 1999 11:25:42 +0000 (11:25 +0000)
committersof <unknown>
Tue, 2 Nov 1999 11:25:42 +0000 (11:25 +0000)
updated with expected-output files

ghc/tests/lib/should_run/io001.hs
ghc/tests/lib/should_run/io001.stdout [new file with mode: 0644]
ghc/tests/lib/should_run/io002.hs
ghc/tests/lib/should_run/io002.stdout [new file with mode: 0644]
ghc/tests/lib/should_run/ioexts001.hs
ghc/tests/lib/should_run/ioexts001.stdout [new file with mode: 0644]

index 9606a2c..ec16fda 100644 (file)
@@ -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 (file)
index 0000000..0726d26
--- /dev/null
@@ -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'
index 17d8639..0bb0cac 100644 (file)
@@ -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 (file)
index 0000000..da4db70
--- /dev/null
@@ -0,0 +1,2 @@
+25
+test string1ttest string4filler string3
index 4f1d9b5..b7f87a4 100644 (file)
@@ -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 (file)
index 0000000..19f86f4
--- /dev/null
@@ -0,0 +1 @@
+done