[ADD] input and output tests
This commit is contained in:
parent
5306105102
commit
7344cc6830
|
@ -4,6 +4,8 @@ println(s)
|
||||||
|
|
||||||
stream = open("elements.txt","r")
|
stream = open("elements.txt","r")
|
||||||
|
|
||||||
|
println(supertype(IOStream))
|
||||||
|
|
||||||
line = readline(stream)
|
line = readline(stream)
|
||||||
|
|
||||||
println(line)
|
println(line)
|
||||||
|
@ -21,6 +23,14 @@ println(read(stream, Int8))
|
||||||
|
|
||||||
println(readstring(stream))
|
println(readstring(stream))
|
||||||
|
|
||||||
|
println(eof(stream))
|
||||||
|
|
||||||
|
close(stream)
|
||||||
|
|
||||||
|
open(readlines,"elements.txt")
|
||||||
|
|
||||||
|
#@edit readstring("elements.txt")
|
||||||
|
|
||||||
myread(s::IOStream) = read(s,Char)
|
myread(s::IOStream) = read(s,Char)
|
||||||
|
|
||||||
println(open(myread,"elements.txt"))
|
println(open(myread,"elements.txt"))
|
||||||
|
@ -46,4 +56,5 @@ open("alpha.txt", "w") do io
|
||||||
for ch in 'A':'Z'
|
for ch in 'A':'Z'
|
||||||
write(io, ch)
|
write(io, ch)
|
||||||
end
|
end
|
||||||
|
write(io,"\n")
|
||||||
end
|
end
|
Loading…
Reference in New Issue