use crate::compact::options;
#[test]
fn compact_flags() {
let args = "--dry-run --headroom-mib 512 --force --report-only --json"
.split_whitespace()
.map(str::to_owned)
.collect::<Vec<_>>();
let (opts, json) = options(&args).unwrap();
assert!(opts.dry_run && opts.force && opts.report_only && json);
assert_eq!(opts.headroom_mib, 512);
assert_eq!(options(&[]).unwrap().0.headroom_mib, 4096);
for bad in [
vec!["--headroom-mib"],
vec!["--headroom-mib", "-1"],
vec!["--other"],
] {
assert!(options(&bad.into_iter().map(str::to_owned).collect::<Vec<_>>()).is_err());
}
}