40 stable releases

Uses new Rust 2024

2.12.4 Jan 18, 2026
2.4.7 Dec 30, 2025
1.3.0 Dec 13, 2025
0.901.0 Dec 9, 2025

#530 in Testing

Download history 4/week @ 2025-12-02 43/week @ 2025-12-09 52/week @ 2025-12-16 96/week @ 2025-12-23 77/week @ 2025-12-30 40/week @ 2026-01-06 81/week @ 2026-01-13 133/week @ 2026-01-20 83/week @ 2026-01-27

356 downloads per month
Used in 103 crates

MIT license

320KB
7K SLoC

Test harness for arborium grammar crates.

This crate provides utilities for testing tree-sitter grammars and their queries.

Usage

In your grammar crate's lib.rs tests:

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_grammar() {
        arborium_test_harness::test_grammar(
            language(),
            "rust",
            HIGHLIGHTS_QUERY,
            INJECTIONS_QUERY,
            LOCALS_QUERY,
            env!("CARGO_MANIFEST_DIR"),
        );
    }
}

arborium-test-harness

Test harness for arborium grammar crates.

Purpose

Provides utilities for testing tree-sitter grammars and their highlight/injection queries.

Usage

In your grammar crate's tests:

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_grammar() {
        arborium_test_harness::test_grammar(
            language(),
            "rust",
            HIGHLIGHTS_QUERY,
            INJECTIONS_QUERY,
            LOCALS_QUERY,
        );
    }
}

The harness validates that:

  • The grammar compiles correctly
  • Highlight queries are syntactically valid
  • Injection queries parse without errors

Part of the arborium project. See arborium.dev for more information.

Dependencies

~3–6MB
~115K SLoC