Skip to content

Commit 72137a6

Browse files
Koenraad VerheydenJoshua Nelson
authored andcommitted
Add test for list_blacklist
1 parent b4589f9 commit 72137a6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/db/blacklist.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ pub fn remove_crate(conn: &Connection, name: &str) -> Result<(), Error> {
5959
mod tests {
6060
use super::*;
6161

62+
#[test]
63+
fn test_list_blacklist() {
64+
crate::test::with_database(|db| {
65+
// crates are added out of order to verify sorting
66+
add_crate(db.conn(), "crate A")?;
67+
add_crate(db.conn(), "crate C")?;
68+
add_crate(db.conn(), "crate B")?;
69+
70+
assert!(list_crates(db.conn())? == vec!["crate A", "crate B", "crate C"]);
71+
Ok(())
72+
});
73+
}
74+
6275
#[test]
6376
fn test_add_to_and_remove_from_blacklist() {
6477
crate::test::with_database(|db| {

0 commit comments

Comments
 (0)