Skip to content

Commit 61c3e04

Browse files
Marcono1234ObserverOfTime
authored andcommitted
test(parser): fix incorrect progress callback implementation
The progress callback has to return `true` to cancel, and `false` to continue.
1 parent efd035e commit 61c3e04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/java/io/github/treesitter/jtreesitter/ParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void parseOptions() {
160160
var source = "}".repeat(1024);
161161
// NOTE: can't use _ because of palantir/palantir-java-format#934
162162
ParseCallback callback = (offset, p) -> source.substring(offset, Integer.min(source.length(), offset + 1));
163-
var options = new Parser.Options((state) -> state.getCurrentByteOffset() <= 1000);
163+
var options = new Parser.Options((state) -> state.getCurrentByteOffset() >= 1000);
164164

165165
parser.setLanguage(language);
166166
assertTrue(parser.parse(callback, InputEncoding.UTF_8, options).isEmpty());

0 commit comments

Comments
 (0)