# interactive()==F
# We run test suites with stderr a tty, so interactive() returns TRUE.
{
	io1 <- tempfile()
	io2 <- "./loop.tests/thorough/io2"
	io3 <- "./loop.tests/thorough/io3"
	io4 <- tempfile()
	io5 <- tempfile()
	io6 <- tempfile()
	allels<-function(a,b){
		ok_T
		n<- max(length(a),length(b))
		for(i in 1:n)
			ok <- ok & all(a[[i]]==b[[i]])
		ok
		}
	 T
}
length(write(c(3.,-4,9e2,1,5), io1))==0
{
	assign("y",scan(io1), w=1)
	all(y==scan(io2))
}
all(scan(io2) == scan(io3))
all(scan(io2, n=2) == scan(io3,n=2))
allels(scan(io2, list(0,""), multi=T), scan(io3, list(0, ""), multi=T))
allels(scan(io1, list(0,""), multi=T), scan(io2, list(0, ""), multi=T))
{
	cat(file=io4, "cat command is OK",y,"\n")
	scan(io4, "", sep="\t")=="cat command is OK 3 -4 900 1 5 "
}
all(dput(y, io1)==y)
all(dget(io1)==y)
{
	assign("old", options(echo=F), frame=1)
	sink(io4)
	cat(y,"\n")
	sink()
	options(old)
	all(scan(io4)==y)
}
dump("y", io5)==io5
{
	yy <- y
	remove("y", w=1)
	source(io5)
	all(y==yy)
}
{
# 	cat("expect message about 'y not found' vvv\n")
	rm(y)
	T
}
{
	sink(io6)
	format(2^seq(10))
	stamp(plot=F)
	sink()
	T
}
platform() == "DOS386" || { source("/dev/null"); T }    # no problem with 0-length input
is.character(unix("date"))
unlink(io1)==0
unlink(io4)==0
unlink(io5)==0
unlink(io6)==0
