mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
fix formatting and unit test
This commit is contained in:
parent
307aadfd8a
commit
aee64016ac
2 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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![]));
|
||||
|
|
Loading…
Reference in a new issue