Add smoke test for tree-sitter parsing

ida_star
Wilfred Hughes 2021-09-05 00:43:38 +07:00
parent 86f7f557b5
commit 2aad08a179
1 changed files with 14 additions and 0 deletions

@ -259,3 +259,17 @@ fn is_last_sibling(cursor: &mut TreeCursor) -> bool {
let node = cursor.node();
node.next_sibling().is_none()
}
#[cfg(test)]
mod tests {
use super::*;
/// Simple smoke test for tree-sitter parsing. Having a test also
/// ensures that this file has its coverage measured.
/// <https://github.com/mozilla/grcov/issues/617>
#[test]
fn test_parse() {
let css_config = from_extension(OsStr::new("css")).unwrap();
parse_to_tree(".foo {}", &css_config);
}
}