(node: Node<'_>)
| 77 | } |
| 78 | |
| 79 | fn attributes(node: Node<'_>) -> Vec<Node<'_>> { |
| 80 | let mut result = Vec::new(); |
| 81 | let mut previous = node.prev_named_sibling(); |
| 82 | while let Some(node) = previous { |
| 83 | if !matches!( |
| 84 | node.kind(), |
| 85 | "attribute_item" | "line_comment" | "block_comment" |
| 86 | ) { |
| 87 | break; |
| 88 | } |
| 89 | if node.kind() == "attribute_item" { |
| 90 | result.push(node); |
| 91 | } |
| 92 | previous = node.prev_named_sibling(); |
| 93 | } |
| 94 | result |
| 95 | } |
| 96 | |
| 97 | fn has_attribute(node: Node<'_>, context: &Context<'_>, expected: &str) -> bool { |
| 98 | attributes(node).into_iter().any(|attribute| { |
no test coverage detected