Comments (6)
@gnprice Did you run script/fetch-fixtures
first? That script needs to be run one time before running the tests; it just clones some of the grammars such as tree-sitter-javascript and tree-sitter-python to use for integration testing. I should probably update these tests to fail with a better error message if those grammars are not present.
from tree-sitter.
Ah indeed, thanks! After running that script, script/test
now runs through its tests without crashing. (It does give a couple of failures; I'll look around a bit and file a separate issue if that isn't already known.)
I think it would be very helpful to have the test check for what it needs and give a proper error message -- when it segfaults, that looks like "this doesn't work on my platform", or "this has a bug that gets tickled on my machine", not "I'm missing a setup step".
Even if sometimes it has to say something like "I'm not sure quite what happened, but there was an error (and here's one thing that sometimes causes that)", that would be much better than dereferencing NULL.
from tree-sitter.
(It does give a couple of failures; I'll look around a bit and file a separate issue if that isn't already known.)
Looks like they're determined by the random seed. Filed as #112!
from tree-sitter.
I think it would be very helpful to have the test check for what it needs and give a proper error message.
I agree. I updated the title of this PR to capture that problem.
Filed as #112!
Ah yeah, I've noticed a few times that there's still have a bug in how we calculate which text ranges have changed their syntax after an edit. Thanks for taking the time to file an issue.
For context, I'm currently working on integrating Tree-sitter into Atom, and there is a bit of work to do on the Atom side, but once I'm done with that, I will fix this and a few other remaining blockers on the Tree-sitter side. It might be a couple of weeks before I get to it.
from tree-sitter.
For context, I'm currently working on integrating Tree-sitter into Atom, and there is a bit of work to do on the Atom side, but once I'm done with that, I will fix this and a few other remaining blockers on the Tree-sitter side. It might be a couple of weeks before I get to it.
Perfectly reasonable -- and thanks for the context!
from tree-sitter.
Now they at least don't crash, and they report a somewhat suggestive error message (No such file or directory
):
test tests::corpus_test::test_real_language_corpus_files ...
Random seed: 1549479004
thread 'tests::corpus_test::test_real_language_corpus_files' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1009:5
from tree-sitter.
Related Issues (20)
- tree-sitter highlight unexpected precedence HOT 3
- Query depends on choice alternatives order HOT 1
- About closed my issue #3240 HOT 1
- Tree-sitter sometimes discards a perfectly valid branch, resulting in ERROR, where valid parse tree exists HOT 4
- Assertion failed when using QueryCursor::matches HOT 2
- query choice operator is non-commutative HOT 2
- Playground should show anonymous nodes
- `TreeCursor::goto_first_child_for_byte` cannot find nodes after ERROR nodes
- `ts_node_parent` can still return wrong parent for a zero-width node HOT 3
- cli build fails HOT 1
- Compile-time kind and field ids that are generated by binding generation. HOT 8
- `failed to rename wasm output file` on different Drive letter HOT 3
- "Failed to locate a package.json file that has a "tree-sitter" section, please ensure you have one, and if you don't then consult the docs" HOT 2
- Test runner can't parse CRLF in some cases
- Add parent language name to grammar.json
- *** stack smashing detected ***: terminated Fatal error 6: Aborted HOT 44
- "generate_parser_in_directory" generates spurious "grammar.js" and "package.json" files when "grammar_path" is specified but not equal to "<repo_path>/grammar.js". HOT 3
- array_reserve does not handle malloc errors HOT 3
- Compile error while following `Rust Tree-sitter` instruction HOT 3
- Parsing string literals in predicates isn't accounting for `\s` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter.