diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-08-24 21:26:19 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-08-27 15:54:43 -0700 |
| commit | fcc031c5b4dc8f64c497b8dd1e066068e862bd72 (patch) | |
| tree | d31401261cbe92f9d5039c193dfcb66b3767e018 /src/test/stdtest | |
| parent | 20178b9312675f4889bd656916a1f32cbacc94d6 (diff) | |
| download | rust-fcc031c5b4dc8f64c497b8dd1e066068e862bd72.tar.gz rust-fcc031c5b4dc8f64c497b8dd1e066068e862bd72.zip | |
Convert std::io to istrs. Issue #855
Diffstat (limited to 'src/test/stdtest')
| -rw-r--r-- | src/test/stdtest/io.rs | 10 | ||||
| -rw-r--r-- | src/test/stdtest/run.rs | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/test/stdtest/io.rs b/src/test/stdtest/io.rs index 08330c619fc..679466cbece 100644 --- a/src/test/stdtest/io.rs +++ b/src/test/stdtest/io.rs @@ -1,15 +1,15 @@ // -*- rust -*- use std; import std::io; -import std::str; +import std::istr; #[cfg(target_os = "linux")] #[cfg(target_os = "win32")] #[test] fn test_simple() { - let tmpfile: str = "test/run-pass/lib-io-test-simple.tmp"; + let tmpfile: istr = ~"test/run-pass/lib-io-test-simple.tmp"; log tmpfile; - let frood: str = "A hoopy frood who really knows where his towel is."; + let frood: istr = ~"A hoopy frood who really knows where his towel is."; log frood; { let out: io::writer = @@ -17,9 +17,9 @@ fn test_simple() { out.write_str(frood); } let inp: io::reader = io::file_reader(tmpfile); - let frood2: str = inp.read_c_str(); + let frood2: istr = inp.read_c_str(); log frood2; - assert (str::eq(frood, frood2)); + assert (istr::eq(frood, frood2)); } // FIXME (726) diff --git a/src/test/stdtest/run.rs b/src/test/stdtest/run.rs index 54f33b3e057..d3e88b13738 100644 --- a/src/test/stdtest/run.rs +++ b/src/test/stdtest/run.rs @@ -3,7 +3,7 @@ import std::run; import std::os; import std::io; import std::option; -import std::str; +import std::istr; import std::vec; // Regression test for memory leaks @@ -36,7 +36,7 @@ fn test_pipes() { os::libc::close(pipe_err.out); if pid == -1 { fail; } - let expected = "test"; + let expected = ~"test"; writeclose(pipe_in.out, expected); let actual = readclose(pipe_out.in); readclose(pipe_err.in); @@ -46,21 +46,21 @@ fn test_pipes() { log actual; assert (expected == actual); - fn writeclose(fd: int, s: &str) { + fn writeclose(fd: int, s: &istr) { let writer = io::new_writer(io::fd_buf_writer(fd, option::none)); writer.write_str(s); os::libc::close(fd); } - fn readclose(fd: int) -> str { + fn readclose(fd: int) -> istr { // Copied from run::program_output let file = os::fd_FILE(fd); let reader = io::new_reader(io::FILE_buf_reader(file, option::none)); - let buf = ""; + let buf = ~""; while !reader.eof() { let bytes = reader.read_bytes(4096u); - buf += str::unsafe_from_bytes(bytes); + buf += istr::unsafe_from_bytes(bytes); } os::libc::fclose(file); ret buf; |
