about summary refs log tree commit diff
path: root/src/test/stdtest/io.rs
blob: 679466cbece0b6cbf4a44c916500f982e3825bae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// -*- rust -*-
use std;
import std::io;
import std::istr;

#[cfg(target_os = "linux")]
#[cfg(target_os = "win32")]
#[test]
fn test_simple() {
    let tmpfile: istr = ~"test/run-pass/lib-io-test-simple.tmp";
    log tmpfile;
    let frood: istr = ~"A hoopy frood who really knows where his towel is.";
    log frood;
    {
        let out: io::writer =
            io::file_writer(tmpfile, [io::create, io::truncate]);
        out.write_str(frood);
    }
    let inp: io::reader = io::file_reader(tmpfile);
    let frood2: istr = inp.read_c_str();
    log frood2;
    assert (istr::eq(frood, frood2));
}

// FIXME (726)
#[cfg(target_os = "macos")]
#[test]
#[ignore]
fn test_simple() { }