normalize-languages 0.3.2

Tree-sitter language support and dynamic grammar loading
Documentation
1
2
3
4
5
6
# normalize-languages/tests

Integration tests for the normalize-languages crate.

- `query_fixtures.rs` — fixture-based tests that parse sample source files, run the six `.scm` query types (tags, calls, complexity, imports, types, decorations), and assert specific captures appear. Tests skip gracefully when grammar `.so` files are not present (`target/grammars/` absent). Build grammars with `cargo xtask build-grammars` to run them with actual grammar execution. For query types that intentionally produce zero captures (e.g. calls on languages where the query is empty), the test binds the result as `let _x = collect_captures(...)` to verify the query executes without panicking. Decoration tests use `assert_decorations_contains` to verify that language-specific decoration syntax (decorators, attributes, annotations, pragmas, doc comments) appears in captures — not just that any capture was returned.
- `fixtures/` — small representative source files (30-60 lines each) used by `query_fixtures.rs`, one per language: Rust, Python, Go, TypeScript, Java, Ruby, Kotlin, Swift, Scala, PHP, Dart, Elixir, C, C++, C#, Haskell, OCaml, Erlang, Lua, Groovy, Julia, R, F#, Gleam, Clojure, Scheme, D, Visual Basic .NET, Objective-C, Idris, Lean 4, ReScript, Elm, Agda, Common Lisp, Emacs Lisp, Prolog, SQL, Starlark, HCL, Nix, MATLAB, TLA+, Zig, Ada, Perl, Bash, PowerShell, Fish, Zsh, AWK, JavaScript, TSX, CMake, GraphQL, GLSL, HLSL, jq, Markdown, Meson, Nginx, SCSS, Svelte, Typst, Verilog, VHDL, Vim script, Vue.