mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 06:34:54 +08:00
fix(repo):统一发布健康与只读质量门禁
This commit is contained in:
@@ -1697,6 +1697,34 @@ mod tests {
|
||||
assert!(!localized.unknown);
|
||||
assert_eq!(report.releases.len(), 2);
|
||||
|
||||
let other_path = official_version.join("other.bin");
|
||||
let other_bytes = fs::read(&other_path).unwrap();
|
||||
let mut same_size_corruption = other_bytes.clone();
|
||||
same_size_corruption[0] ^= 0xff;
|
||||
fs::write(&other_path, &same_size_corruption).unwrap();
|
||||
let same_size_report =
|
||||
build_release_status(&official_root, &localized_root, Path::new("unzip")).unwrap();
|
||||
let same_size_official = same_size_report
|
||||
.releases
|
||||
.iter()
|
||||
.find(|release| release.channel == "official" && release.current)
|
||||
.unwrap();
|
||||
assert_eq!(same_size_official.distribution_integrity_status, "invalid");
|
||||
assert!(!same_size_report.official_distribution_ready);
|
||||
fs::write(&other_path, &other_bytes).unwrap();
|
||||
|
||||
fs::write(&other_path, [other_bytes.as_slice(), b"!"].concat()).unwrap();
|
||||
let size_report =
|
||||
build_release_status(&official_root, &localized_root, Path::new("unzip")).unwrap();
|
||||
assert!(!size_report.official_distribution_ready);
|
||||
fs::write(&other_path, &other_bytes).unwrap();
|
||||
|
||||
fs::remove_file(&other_path).unwrap();
|
||||
let missing_report =
|
||||
build_release_status(&official_root, &localized_root, Path::new("unzip")).unwrap();
|
||||
assert!(!missing_report.official_distribution_ready);
|
||||
fs::write(&other_path, &other_bytes).unwrap();
|
||||
|
||||
fs::remove_file(official_version.join(crate::OFFICIAL_DISTRIBUTION_PUBLICATION_FILE))
|
||||
.unwrap();
|
||||
let missing_publication = select_release_distribution(
|
||||
|
||||
Reference in New Issue
Block a user