GithubHelp home page GithubHelp logo

Comments (6)

maxbrunsfeld avatar maxbrunsfeld commented on May 16, 2024

@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.

gnprice avatar gnprice commented on May 16, 2024

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.

gnprice avatar gnprice commented on May 16, 2024

(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.

maxbrunsfeld avatar maxbrunsfeld commented on May 16, 2024

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.

gnprice avatar gnprice commented on May 16, 2024

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.

maxbrunsfeld avatar maxbrunsfeld commented on May 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.