2011-06-02 10:58:49 -05:00
|
|
|
// xfail-stage0
|
2010-08-20 14:57:38 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
use std;
|
2011-05-12 10:24:54 -05:00
|
|
|
import std::io;
|
2011-05-17 13:41:41 -05:00
|
|
|
import std::str;
|
2010-08-20 14:57:38 -05:00
|
|
|
|
2011-07-21 21:36:55 -05:00
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
#[cfg(target_os = "win32")]
|
2011-07-21 20:10:11 -05:00
|
|
|
fn test_simple() {
|
|
|
|
let str tmpfile = "test/run-pass/lib-io-test-simple.tmp";
|
2011-06-15 13:19:50 -05:00
|
|
|
log tmpfile;
|
|
|
|
let str frood = "A hoopy frood who really knows where his towel is.";
|
|
|
|
log frood;
|
|
|
|
{
|
2011-07-21 20:10:11 -05:00
|
|
|
let io::writer out = io::file_writer(tmpfile, [io::create,
|
|
|
|
io::truncate]);
|
2011-06-15 13:19:50 -05:00
|
|
|
out.write_str(frood);
|
|
|
|
}
|
|
|
|
let io::reader inp = io::file_reader(tmpfile);
|
|
|
|
let str frood2 = inp.read_c_str();
|
|
|
|
log frood2;
|
|
|
|
assert (str::eq(frood, frood2));
|
2010-08-20 14:57:38 -05:00
|
|
|
}
|
|
|
|
|
2011-07-21 21:36:55 -05:00
|
|
|
// FIXME (726)
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
fn test_simple() {}
|
|
|
|
|
2011-07-21 20:10:11 -05:00
|
|
|
fn main() {
|
|
|
|
test_simple();
|
|
|
|
}
|