diff options
| author | bors <bors@rust-lang.org> | 2013-06-01 17:13:39 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-01 17:13:39 -0700 |
| commit | 63417daea4058646ef07a880edc79653ddc16bbf (patch) | |
| tree | 5d6e75e2ee5567640812d8f4132122d69fc25da1 /src/libstd | |
| parent | 24e85ac82d000a71276eb4cf2090bd176a3638bf (diff) | |
| parent | 23808efd11be2a9f964373bd8d684d98565e58d0 (diff) | |
| download | rust-63417daea4058646ef07a880edc79653ddc16bbf.tar.gz rust-63417daea4058646ef07a880edc79653ddc16bbf.zip | |
auto merge of #6885 : erickt/rust/move-callee_id, r=catamorphism
The `callee_id` in `ast::expr` in only used in a couple expression variants. This moves the `callee_id` into those branches to make it more clear when its should be used. Also, it fixes a bug in a std::run test when there is a symlink in the path rust where was checked out.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/run.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libstd/run.rs b/src/libstd/run.rs index 07b521d0197..3b17067feba 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -1100,28 +1100,34 @@ mod tests { #[test] fn test_keep_current_working_dir() { - let mut prog = run_pwd(None); let output = str::from_bytes(prog.finish_with_output().output); let parent_dir = os::getcwd().normalize(); let child_dir = Path(output.trim()).normalize(); - assert_eq!(child_dir.to_str(), parent_dir.to_str()); + let parent_stat = parent_dir.stat().unwrap(); + let child_stat = child_dir.stat().unwrap(); + + assert_eq!(parent_stat.st_dev, child_stat.st_dev); + assert_eq!(parent_stat.st_ino, child_stat.st_ino); } #[test] fn test_change_working_directory() { - // test changing to the parent of os::getcwd() because we know // the path exists (and os::getcwd() is not expected to be root) - let parent_path = os::getcwd().dir_path().normalize(); - let mut prog = run_pwd(Some(&parent_path)); + let parent_dir = os::getcwd().dir_path().normalize(); + let mut prog = run_pwd(Some(&parent_dir)); let output = str::from_bytes(prog.finish_with_output().output); let child_dir = Path(output.trim()).normalize(); - assert_eq!(child_dir.to_str(), parent_path.to_str()); + let parent_stat = parent_dir.stat().unwrap(); + let child_stat = child_dir.stat().unwrap(); + + assert_eq!(parent_stat.st_dev, child_stat.st_dev); + assert_eq!(parent_stat.st_ino, child_stat.st_ino); } #[cfg(unix)] |
