@@ -1100,28 +1100,34 @@ mod tests {
1100
1100
1101
1101
#[test]
1102
1102
fn test_keep_current_working_dir() {
1103
-
1104
1103
let mut prog = run_pwd(None);
1105
1104
1106
1105
let output = str::from_bytes(prog.finish_with_output().output);
1107
1106
let parent_dir = os::getcwd().normalize();
1108
1107
let child_dir = Path(output.trim()).normalize();
1109
1108
1110
- assert_eq!(child_dir.to_str(), parent_dir.to_str());
1109
+ let parent_stat = parent_dir.stat().unwrap();
1110
+ let child_stat = child_dir.stat().unwrap();
1111
+
1112
+ assert_eq!(parent_stat.st_dev, child_stat.st_dev);
1113
+ assert_eq!(parent_stat.st_ino, child_stat.st_ino);
1111
1114
}
1112
1115
1113
1116
#[test]
1114
1117
fn test_change_working_directory() {
1115
-
1116
1118
// test changing to the parent of os::getcwd() because we know
1117
1119
// the path exists (and os::getcwd() is not expected to be root)
1118
- let parent_path = os::getcwd().dir_path().normalize();
1119
- let mut prog = run_pwd(Some(&parent_path ));
1120
+ let parent_dir = os::getcwd().dir_path().normalize();
1121
+ let mut prog = run_pwd(Some(&parent_dir ));
1120
1122
1121
1123
let output = str::from_bytes(prog.finish_with_output().output);
1122
1124
let child_dir = Path(output.trim()).normalize();
1123
1125
1124
- assert_eq!(child_dir.to_str(), parent_path.to_str());
1126
+ let parent_stat = parent_dir.stat().unwrap();
1127
+ let child_stat = child_dir.stat().unwrap();
1128
+
1129
+ assert_eq!(parent_stat.st_dev, child_stat.st_dev);
1130
+ assert_eq!(parent_stat.st_ino, child_stat.st_ino);
1125
1131
}
1126
1132
1127
1133
#[cfg(unix)]
0 commit comments