test: add a reproducing test for #2162
This commit is contained in:
parent
0376533c04
commit
0d326824d2
2 changed files with 17 additions and 0 deletions
16
cli/src/tests/github_issue_test.rs
Normal file
16
cli/src/tests/github_issue_test.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Tests in this mod need be executed with enabled UBSAN library:
|
||||
// ```
|
||||
// UBSAN_OPTIONS="halt_on_error=1" \
|
||||
// CFLAGS="-fsanitize=undefined" \
|
||||
// RUSTFLAGS="-lubsan" \
|
||||
// cargo test --target $(rustc -vV | sed -nr 's/^host: //p') -- --test-threads 1
|
||||
// ```
|
||||
|
||||
use crate::tests::helpers::fixtures::get_language;
|
||||
use tree_sitter::Query;
|
||||
|
||||
#[test]
|
||||
fn issue_2162_out_of_bound() {
|
||||
let language = get_language("java");
|
||||
assert!(Query::new(language, "(package_declaration _ (_) @name _)").is_ok());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue