fix formatting and unit test

This commit is contained in:
Damien Elmes 2020-03-21 08:17:24 +10:00
parent 307aadfd8a
commit aee64016ac
2 changed files with 3 additions and 5 deletions

View file

@ -16,9 +16,7 @@ pub(crate) fn child_ids<'a>(decks: &'a [Deck], name: &str) -> impl Iterator<Item
let prefix = format!("{}::", name.to_ascii_lowercase());
decks
.iter()
.filter(move |d| {
d.name.to_ascii_lowercase().starts_with(&prefix)
})
.filter(move |d| d.name.to_ascii_lowercase().starts_with(&prefix))
.map(|d| d.id)
}

View file

@ -484,11 +484,11 @@ mod test {
// tags
assert_eq!(
s(ctx, "tag:one"),
("(n.tags like ?)".into(), vec!["% one %".into()])
("(n.tags like ? escape '\\')".into(), vec!["% one %".into()])
);
assert_eq!(
s(ctx, "tag:o*e"),
("(n.tags like ?)".into(), vec!["% o%e %".into()])
("(n.tags like ? escape '\\')".into(), vec!["% o%e %".into()])
);
assert_eq!(s(ctx, "tag:none"), ("(n.tags = '')".into(), vec![]));
assert_eq!(s(ctx, "tag:*"), ("(true)".into(), vec![]));