aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-14 18:30:12 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-14 18:30:12 +0200
commit291cb06fc2d578ac19c01ebda9b71f94733af0e8 (patch)
tree42de2f30f49d1bf86239074abfa9578d560c7e1e /bindings
parent3a3ed761881ac220b517c30e1e4596ecead4f354 (diff)
Fix comment queries for Neovim
Diffstat (limited to 'bindings')
-rw-r--r--bindings/node/binding_test.js9
-rw-r--r--bindings/python/tests/test_binding.py11
-rw-r--r--bindings/swift/TreeSitterGspTests/TreeSitterGspTests.swift12
3 files changed, 32 insertions, 0 deletions
diff --git a/bindings/node/binding_test.js b/bindings/node/binding_test.js
new file mode 100644
index 0000000..afede30
--- /dev/null
+++ b/bindings/node/binding_test.js
@@ -0,0 +1,9 @@
+/// <reference types="node" />
+
+const assert = require("node:assert");
+const { test } = require("node:test");
+
+test("can load grammar", () => {
+ const parser = new (require("tree-sitter"))();
+ assert.doesNotThrow(() => parser.setLanguage(require(".")));
+});
diff --git a/bindings/python/tests/test_binding.py b/bindings/python/tests/test_binding.py
new file mode 100644
index 0000000..9da0402
--- /dev/null
+++ b/bindings/python/tests/test_binding.py
@@ -0,0 +1,11 @@
+from unittest import TestCase
+
+import tree_sitter, tree_sitter_gsp
+
+
+class TestLanguage(TestCase):
+ def test_can_load_grammar(self):
+ try:
+ tree_sitter.Language(tree_sitter_gsp.language())
+ except Exception:
+ self.fail("Error loading Gsp grammar")
diff --git a/bindings/swift/TreeSitterGspTests/TreeSitterGspTests.swift b/bindings/swift/TreeSitterGspTests/TreeSitterGspTests.swift
new file mode 100644
index 0000000..df7bc99
--- /dev/null
+++ b/bindings/swift/TreeSitterGspTests/TreeSitterGspTests.swift
@@ -0,0 +1,12 @@
+import XCTest
+import SwiftTreeSitter
+import TreeSitterGsp
+
+final class TreeSitterGspTests: XCTestCase {
+ func testCanLoadGrammar() throws {
+ let parser = Parser()
+ let language = Language(language: tree_sitter_gsp())
+ XCTAssertNoThrow(try parser.setLanguage(language),
+ "Error loading Gsp grammar")
+ }
+}