zls
zls copied to clipboard
Improve tests
Sooner or later we will need to add tests to check for regressions.
I propose the following three kinds of tests:
- Function unit tests (mainly for the parsing functions)
- I/O testing: simulate a client sending requests from a different process and check the responses are correct
- Internal state testing: simulate a client sending requests from a different process and check our internal state (number of documents, text of documents, latest sane_text of documents etc.)
Looks interesting. Not sure if it's a priority right now, but definitely down the line.
Started adding session tests, coverage going up 🎉
hi i recently started learning zig and this seems like a beginner-friendly issue to get started with but when i try to run unit tests using zig test unit_test.zig i get an error saying
./unit_tests.zig:2:15: error: unable to find 'types'
const types = @import("types");
^
./unit_tests.zig:23:43: note: referenced here
fn makeUnnamedDocument(text: []const u8) !types.TextDocument {
^
./unit_tests.zig:31:21: note: referenced here
const doc = try makeUnnamedDocument(final_line);
^
./unit_tests.zig:68:5: note: referenced here
try testContext(
^
am i running the tests the wrong way ? i tried looking for docs on testing and also tried looking in the ci workflow for a test job but couldnt find anything.
PS i am able to build the repo locally
am i running the tests the wrong way ?
Yes. Try execute zig build test in zls root folder.
I think #609 closed this. Closing in favor of #623.