(node: Node<'_>, context: &Context<'_>, expected: &str)
| 95 | } |
| 96 | |
| 97 | fn has_attribute(node: Node<'_>, context: &Context<'_>, expected: &str) -> bool { |
| 98 | attributes(node).into_iter().any(|attribute| { |
| 99 | tokens::named(attribute) |
| 100 | .into_iter() |
| 101 | .filter(|node| node.kind() == "attribute") |
| 102 | .any(|attribute| { |
| 103 | code_children(attribute).first().is_some_and(|path| { |
| 104 | tokens::text(*path, context.source).rsplit("::").next() == Some(expected) |
| 105 | }) |
| 106 | }) |
| 107 | }) |
| 108 | } |
| 109 | |
| 110 | fn is_test(node: Node<'_>, context: &Context<'_>) -> bool { |
| 111 | has_attribute(node, context, "test") |
no test coverage detected