[project @ 2000-04-11 09:40:19 by simonmar]
authorsimonmar <unknown>
Tue, 11 Apr 2000 09:40:19 +0000 (09:40 +0000)
committersimonmar <unknown>
Tue, 11 Apr 2000 09:40:19 +0000 (09:40 +0000)
Add nested hPutStr/tracing test

ghc/tests/io/should_run/Makefile
ghc/tests/io/should_run/io018.hs
ghc/tests/io/should_run/io032.hs [new file with mode: 0644]
ghc/tests/io/should_run/io032.stderr [new file with mode: 0644]
ghc/tests/io/should_run/io032.stdout [new file with mode: 0644]

index bc747f6..6cc9f8c 100644 (file)
@@ -6,6 +6,7 @@ HC_OPTS += -dcore-lint
 io022_HC_OPTS += -fglasgow-exts
 io010_HC_OPTS += -fglasgow-exts
 io011_HC_OPTS += -fglasgow-exts
+io032_HC_OPTS += -fglasgow-exts
 
 io004_RUNTEST_OPTS += -x 42
 io016_RUNTEST_OPTS += io016.hs io016.out
index ac392aa..02b24bb 100644 (file)
@@ -17,13 +17,13 @@ main = do
    hSetBuffering cd NoBuffering
    hPutStr cd speakString
    hSeek cd AbsoluteSeek 0
-   speak cd  `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else fail err
+   speak cd  `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err
    hSeek cd AbsoluteSeek 0
    hSetBuffering cd LineBuffering
-   speak cd  `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else fail err
+   speak cd  `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err
    hSeek cd AbsoluteSeek 0
    hSetBuffering cd (BlockBuffering Nothing)
-   speak cd  `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else fail err
+   speak cd  `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err
 
 speakString = "Someone wants to speak with you\n"
 
diff --git a/ghc/tests/io/should_run/io032.hs b/ghc/tests/io/should_run/io032.hs
new file mode 100644 (file)
index 0000000..5e340e0
--- /dev/null
@@ -0,0 +1,10 @@
+import IO
+import IOExts
+
+main = do
+   hPutStr stderr
+       (trace (trace (trace (trace (trace (trace (trace
+         "one" "fish") "two") "fish") "red") "fish") "blue") "fish")
+   hPutStr stdout
+       (trace (trace (trace (trace (trace (trace (trace
+         "one" "fish") "two") "fish") "red") "fish") "blue") "fish")
diff --git a/ghc/tests/io/should_run/io032.stderr b/ghc/tests/io/should_run/io032.stderr
new file mode 100644 (file)
index 0000000..3b8ac7a
--- /dev/null
@@ -0,0 +1,14 @@
+one
+fish
+two
+fish
+red
+fish
+blue
+fishone
+fish
+two
+fish
+red
+fish
+blue
diff --git a/ghc/tests/io/should_run/io032.stdout b/ghc/tests/io/should_run/io032.stdout
new file mode 100644 (file)
index 0000000..5b19477
--- /dev/null
@@ -0,0 +1 @@
+fish
\ No newline at end of file