fix(bindings): update zig template files (#4637)
This commit is contained in:
parent
f7838748df
commit
d87921bb9c
5 changed files with 99 additions and 59 deletions
17
crates/cli/src/templates/test.zig
Normal file
17
crates/cli/src/templates/test.zig
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
const testing = @import("std").testing;
|
||||
|
||||
const ts = @import("tree-sitter");
|
||||
const root = @import("tree-sitter-PARSER_NAME");
|
||||
const Language = ts.Language;
|
||||
const Parser = ts.Parser;
|
||||
|
||||
test "can load grammar" {
|
||||
const parser = Parser.create();
|
||||
defer parser.destroy();
|
||||
|
||||
const lang: *const ts.Language = @ptrCast(root.language());
|
||||
defer lang.destroy();
|
||||
|
||||
try testing.expectEqual(void{}, parser.setLanguage(lang));
|
||||
try testing.expectEqual(lang, parser.getLanguage());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue