mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
test(utils): cover scanner env alias mapping (#2574)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -686,6 +686,28 @@ mod tests {
|
||||
assert_eq!(report.conflict_count(), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scanner_aliases_are_mapped_when_rustfs_missing() {
|
||||
let report = build_external_env_compat_report_from_entries(vec![
|
||||
(source_key("SCANNER_SPEED"), "slow".to_string()),
|
||||
(source_key("SCANNER_CYCLE"), "600".to_string()),
|
||||
]);
|
||||
assert_eq!(report.mapped_count(), 2);
|
||||
assert!(
|
||||
report
|
||||
.mapped_pairs
|
||||
.iter()
|
||||
.any(|(input_key, rustfs_key)| input_key == &source_key("SCANNER_SPEED") && rustfs_key == "RUSTFS_SCANNER_SPEED")
|
||||
);
|
||||
assert!(
|
||||
report
|
||||
.mapped_pairs
|
||||
.iter()
|
||||
.any(|(input_key, rustfs_key)| input_key == &source_key("SCANNER_CYCLE") && rustfs_key == "RUSTFS_SCANNER_CYCLE")
|
||||
);
|
||||
assert_eq!(report.conflict_count(), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rustfs_value_takes_precedence_on_conflict() {
|
||||
let report = build_external_env_compat_report_from_entries(vec![
|
||||
|
||||
Reference in New Issue
Block a user