qbt-clean 0.144.0

Automated rules-based cleaning of qBittorrent torrents.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[test]
fn fmt_bytes_below_kib_stays_in_bytes() {
	assert_eq!(format!("{}", crate::FmtBytes(0)), "0 B");
	assert_eq!(format!("{}", crate::FmtBytes(999)), "999 B");
	assert_eq!(format!("{}", crate::FmtBytes(1023)), "0.99 kiB");
}

#[test]
fn fmt_bytes_at_kib_boundary_uses_binary_prefix() {
	assert_eq!(format!("{}", crate::FmtBytes(1024)), "1.00 kiB");
}

#[test]
fn fmt_bytes_uses_binary_division() {
	assert_eq!(format!("{}", crate::FmtBytes(1024 * 1024)), "1.00 MiB");
	assert_eq!(format!("{}", crate::FmtBytes(1024 * 1024 * 1024)), "1.00 GiB");
}