2011-03-25 14:19:20 -05:00
|
|
|
// xfail-boot
|
|
|
|
// xfail-stage0
|
2010-08-20 14:57:38 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
use std;
|
2011-02-22 17:58:07 -06:00
|
|
|
import std.io;
|
2010-08-20 14:57:38 -05:00
|
|
|
import std._str;
|
|
|
|
|
|
|
|
fn test_simple(str tmpfilebase) {
|
|
|
|
let str tmpfile = tmpfilebase + ".tmp";
|
|
|
|
log tmpfile;
|
|
|
|
let str frood = "A hoopy frood who really knows where his towel is.";
|
|
|
|
log frood;
|
|
|
|
|
|
|
|
{
|
2011-04-13 14:05:04 -05:00
|
|
|
let io.writer out = io.file_writer(tmpfile, vec(io.create));
|
|
|
|
out.write_str(frood);
|
2010-08-20 14:57:38 -05:00
|
|
|
}
|
|
|
|
|
2011-04-13 14:05:04 -05:00
|
|
|
let io.reader inp = io.file_reader(tmpfile);
|
|
|
|
let str frood2 = inp.read_c_str();
|
2010-08-20 14:57:38 -05:00
|
|
|
log frood2;
|
|
|
|
check (_str.eq(frood, frood2));
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main(vec[str] argv) {
|
|
|
|
test_simple(argv.(0));
|
|
|
|
}
|