Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
27ed03ed
Commit
27ed03ed
authored
Aug 01, 2005
by
simonmar
Browse files
[project @ 2005-08-01 13:26:43 by simonmar]
add System.Process test
parent
35ad9b5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/lib/Process/all.T
View file @
27ed03ed
test
('
process001
',
normal
,
compile_and_run
,
[''])
test
('
process002
',
normal
,
compile_and_run
,
[''])
test
('
process003
',
normal
,
compile_and_run
,
[''])
testsuite/tests/ghc-regress/lib/Process/process003.hs
0 → 100644
View file @
27ed03ed
-- [ ghc-Bugs-1249226 ] runInteractiveProcess and closed stdin.
-- Fixed in rev 1.9 of fptools/libraries/base/cbits/runProcess.c
import
System.IO
import
Control.Concurrent
import
System.Process
main
=
do
hClose
stdin
-- everything works as expected if the handle isn't closed.
putStrLn
"Running cat ..."
(
inp
,
out
,
err
,
pid
)
<-
runInteractiveProcess
"cat"
[]
Nothing
Nothing
forkIO
(
hPutStrLn
inp
"foo"
>>
hClose
inp
)
mout
<-
newEmptyMVar
merr
<-
newEmptyMVar
forkIO
(
hGetContents
out
>>=
\
s
->
length
s
`
seq
`
putMVar
mout
s
)
forkIO
(
hGetContents
err
>>=
\
s
->
length
s
`
seq
`
putMVar
merr
s
)
-- Don't want to deal with waitForProcess and -threaded right now.
takeMVar
mout
>>=
putStrLn
takeMVar
merr
>>=
putStrLn
return
()
testsuite/tests/ghc-regress/lib/Process/process003.stdout
0 → 100644
View file @
27ed03ed
Running cat ...
foo
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment