diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-01-30 14:28:20 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-03 09:32:34 -0800 |
| commit | 41cde566bb81bdd5f9ffdefadc7c8256c65624dc (patch) | |
| tree | 5e604ccb7379c89f7c81558b5376a5ffde0035af /src/libextra/workcache.rs | |
| parent | 209642c65177d6cf42dd4eea693040aa91cde9ee (diff) | |
extra: Fix tests with io_error usage
Diffstat (limited to 'src/libextra/workcache.rs')
| -rw-r--r-- | src/libextra/workcache.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index 3d91ccda189..4d8e7e50dcf 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -473,13 +473,13 @@ fn test() { fn make_path(filename: ~str) -> Path { let pth = os::self_exe_path().expect("workcache::test failed").with_filename(filename); if pth.exists() { - fs::unlink(&pth); + fs::unlink(&pth).unwrap(); } return pth; } let pth = make_path(~"foo.c"); - File::create(&pth).write(bytes!("int main() { return 0; }")); + File::create(&pth).write(bytes!("int main() { return 0; }")).unwrap(); let db_path = make_path(~"db.json"); @@ -491,7 +491,8 @@ fn test() { let subcx = cx.clone(); let pth = pth.clone(); - let file_content = from_utf8_owned(File::open(&pth).read_to_end()).unwrap(); + let contents = File::open(&pth).read_to_end().unwrap(); + let file_content = from_utf8_owned(contents).unwrap(); // FIXME (#9639): This needs to handle non-utf8 paths prep.declare_input("file", pth.as_str().unwrap(), file_content); @@ -500,7 +501,7 @@ fn test() { // FIXME (#9639): This needs to handle non-utf8 paths run::process_status("gcc", [pth.as_str().unwrap().to_owned(), ~"-o", - out.as_str().unwrap().to_owned()]); + out.as_str().unwrap().to_owned()]).unwrap(); let _proof_of_concept = subcx.prep("subfn"); // Could run sub-rules inside here. |
