test: satisfy clippy assert_is_empty
Stable 1.99 added the lint and CI denies warnings, which failed the build and skipped the deploy. Each flagged assert now uses the assert_eq! form clippy suggests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1b6dae676a
commit
ee7f05bf22
@@ -1904,7 +1904,7 @@ mod tests {
|
||||
action.tick(&database).await.unwrap();
|
||||
let outcomes = action.tick(&database).await.unwrap();
|
||||
|
||||
assert!(outcomes.is_empty());
|
||||
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||
assert_eq!(fake.torrents().len(), 1);
|
||||
assert_eq!(grabs(&database).await.len(), 1);
|
||||
}
|
||||
@@ -2163,7 +2163,7 @@ mod tests {
|
||||
|
||||
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||
|
||||
assert!(outcomes.is_empty());
|
||||
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||
assert!(fake.torrents().is_empty());
|
||||
}
|
||||
|
||||
@@ -2244,7 +2244,10 @@ mod tests {
|
||||
|
||||
action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||
|
||||
assert!(grabs(&database).await.is_empty());
|
||||
assert_eq!(
|
||||
grabs(&database).await,
|
||||
[] as [(i64, std::string::String, std::string::String); 0]
|
||||
);
|
||||
assert!(
|
||||
fake.torrents().is_empty(),
|
||||
"a torrent added this tick and then found blacklisted is removed"
|
||||
@@ -2311,7 +2314,10 @@ mod tests {
|
||||
assert_eq!(targeted_searches(&indexer).await, 1);
|
||||
assert_eq!(deck(&database).await.len(), 3, "every candidate is cached");
|
||||
assert!(fake.torrents().is_empty());
|
||||
assert!(grabs(&database).await.is_empty());
|
||||
assert_eq!(
|
||||
grabs(&database).await,
|
||||
[] as [(i64, std::string::String, std::string::String); 0]
|
||||
);
|
||||
}
|
||||
|
||||
/// The digital-release gate belongs to targeted search (§6.2). A movie
|
||||
@@ -2385,7 +2391,10 @@ mod tests {
|
||||
|
||||
assert!(outcome.is_none());
|
||||
assert_eq!(targeted_searches(&indexer).await, 0);
|
||||
assert!(deck(&database).await.is_empty());
|
||||
assert_eq!(
|
||||
deck(&database).await,
|
||||
[] as [(std::string::String, std::string::String); 0]
|
||||
);
|
||||
assert!(fake.torrents().is_empty());
|
||||
}
|
||||
|
||||
@@ -2402,9 +2411,12 @@ mod tests {
|
||||
|
||||
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||
|
||||
assert!(outcomes.is_empty());
|
||||
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||
assert!(fake.torrents().is_empty());
|
||||
assert!(grabs(&database).await.is_empty());
|
||||
assert_eq!(
|
||||
grabs(&database).await,
|
||||
[] as [(i64, std::string::String, std::string::String); 0]
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
@@ -1835,7 +1835,7 @@ mod tests {
|
||||
|
||||
let outcomes = h.action.tick(&h.database).await.unwrap();
|
||||
|
||||
assert!(outcomes.is_empty());
|
||||
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||
}
|
||||
|
||||
/// #108, overriding §86: a `downloaded` grab whose torrent qBittorrent
|
||||
|
||||
@@ -171,7 +171,10 @@ mod tests {
|
||||
let action = ReaperAction::new(QbitClient::new(&server.uri()).unwrap());
|
||||
|
||||
let labels = HashSet::from(["movies-main".to_owned()]);
|
||||
assert!(action.tick(&labels).await.unwrap().is_empty());
|
||||
assert_eq!(
|
||||
action.tick(&labels).await.unwrap(),
|
||||
[] as [crate::reconcile::Outcome; 0]
|
||||
);
|
||||
assert!(deleted.lock().unwrap().is_empty());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -983,9 +983,12 @@ mod tests {
|
||||
|
||||
let outcomes = action(&indexer, &downloader).tick(&database).await.unwrap();
|
||||
|
||||
assert!(outcomes.is_empty());
|
||||
assert_eq!(outcomes, [] as [crate::reconcile::Outcome; 0]);
|
||||
assert!(fake.added.lock().unwrap().is_empty());
|
||||
assert!(stored_releases(&database).await.is_empty());
|
||||
assert_eq!(
|
||||
stored_releases(&database).await,
|
||||
[] as [std::string::String; 0]
|
||||
);
|
||||
}
|
||||
|
||||
/// §6.2: RSS never backs off, so nothing it does may spend one of
|
||||
|
||||
@@ -998,7 +998,7 @@ mod tests {
|
||||
let after_first = server.received_requests().await.unwrap().len();
|
||||
|
||||
let second = action(&server).tick(&database).await.unwrap();
|
||||
assert!(second.is_empty());
|
||||
assert_eq!(second, [] as [crate::reconcile::Outcome; 0]);
|
||||
assert_eq!(
|
||||
server.received_requests().await.unwrap().len(),
|
||||
after_first,
|
||||
|
||||
Reference in New Issue
Block a user