2011-03-25 14:19:20 -05:00
|
|
|
// xfail-boot
|
2011-04-29 18:55:24 -05:00
|
|
|
// xfail-stage0
|
2011-05-03 20:13:51 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2010-08-20 14:57:38 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
use std;
|
2011-05-06 15:13:13 -05:00
|
|
|
import std.IO;
|
|
|
|
import std.Str;
|
2010-08-20 14:57:38 -05:00
|
|
|
|
|
|
|
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-05-06 15:13:13 -05:00
|
|
|
let IO.writer out = IO.file_writer(tmpfile, vec(IO.create));
|
2011-04-13 14:05:04 -05:00
|
|
|
out.write_str(frood);
|
2010-08-20 14:57:38 -05:00
|
|
|
}
|
|
|
|
|
2011-05-06 15:13:13 -05:00
|
|
|
let IO.reader inp = IO.file_reader(tmpfile);
|
2011-04-13 14:05:04 -05:00
|
|
|
let str frood2 = inp.read_c_str();
|
2010-08-20 14:57:38 -05:00
|
|
|
log frood2;
|
2011-05-06 15:13:13 -05:00
|
|
|
assert (Str.eq(frood, frood2));
|
2010-08-20 14:57:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main(vec[str] argv) {
|
|
|
|
test_simple(argv.(0));
|
|
|
|
}
|