Add some tests to check for the nested documents ids

This commit is contained in:
Kerollmops
2022-07-12 12:42:06 +02:00
parent a892a4a79c
commit 192793ee38
2 changed files with 55 additions and 6 deletions

View File

@ -257,12 +257,9 @@ impl fmt::Debug for DocumentId {
}
fn contained_in(selector: &str, key: &str) -> bool {
selector.starts_with(key)
&& selector[key.len()..]
.chars()
.next()
.map(|c| c == PRIMARY_KEY_SPLIT_SYMBOL)
.unwrap_or(true)
selector.strip_prefix(key).map_or(false, |tail| {
tail.chars().next().map(|c| c == PRIMARY_KEY_SPLIT_SYMBOL).unwrap_or(true)
})
}
pub fn fetch_matching_values(value: Value, selector: &str, output: &mut Vec<Value>) {