Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
d26caffa
Commit
d26caffa
authored
Nov 25, 2010
by
Simon Marlow
Browse files
add some Unicdoe to the hSeek/hTell test
parent
263e0f51
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/lib/IOExts/hTell002.hs
View file @
d26caffa
...
...
@@ -7,7 +7,8 @@ import Directory
main
::
IO
()
main
=
do
h
<-
openBinaryFile
"tst-seek"
WriteMode
h
<-
openFile
"tst-seek"
WriteMode
hSetEncoding
h
utf8
-- hSeek/hTell work with Unicode streams
hPutStr
h
"test string1"
-- seek to EOF should be cool..
hSeek
h
SeekFromEnd
0
...
...
@@ -19,8 +20,15 @@ main = do
hPutStr
h
"test string4"
x
<-
hTell
h
print
x
hSeek
h
AbsoluteSeek
30
x1
<-
hTell
h
hPutStr
h
"人間虫"
-- we should be able to output Unicode too
x2
<-
hTell
h
print
(
x2
-
x1
)
hPutStr
h
"filler"
hClose
h
ls
<-
readFile
"tst-seek"
putStrLn
ls
h
<-
openFile
"tst-seek"
ReadMode
hSetEncoding
h
utf8
str
<-
hGetContents
h
putStrLn
str
removeFile
"tst-seek"
testsuite/tests/ghc-regress/lib/IOExts/hTell002.stdout
View file @
d26caffa
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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