Skip to content

Commit 8018037

Browse files
committed
Better asserts
These assertions were not providing any diagnostic information
1 parent cfb64f2 commit 8018037

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/cli-self-upd.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,10 @@ fn install_adds_path() {
499499
expect_ok(config, &["rustup-init", "-y"]);
500500

501501
let path = config.cargodir.join("bin").to_string_lossy().to_string();
502-
assert!(get_path().unwrap().contains(&path));
502+
assert!(
503+
get_path().unwrap().contains(&path),
504+
format!("`{}` not in `{}`", get_path().unwrap(), &path)
505+
);
503506
});
504507
}
505508

@@ -558,7 +561,7 @@ fn install_doesnt_modify_path_if_passed_no_modify_path() {
558561
.unwrap();
559562
let new_path = environment.get_raw_value("PATH").unwrap();
560563

561-
assert!(old_path == new_path);
564+
assert_eq!(old_path, new_path);
562565
});
563566
}
564567

@@ -1155,7 +1158,7 @@ fn install_doesnt_mess_with_a_non_unicode_path() {
11551158
.open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE)
11561159
.unwrap();
11571160
let path = environment.get_raw_value("PATH").unwrap();
1158-
assert!(path.bytes == reg_value.bytes);
1161+
assert_eq!(path.bytes, reg_value.bytes);
11591162
});
11601163
}
11611164

0 commit comments

Comments
 (0)