nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.45k stars 123 forks source link

Test reports using neotest-vim-test with rust give false positives #72

Closed tomhampshire closed 2 years ago

tomhampshire commented 2 years ago

Running: lua require("neotest").run.run(vim.fn.expand("%")) on a rust source code file shows both false positives and false negatives.

A minimal test file is below. In this example, the function, and the test, both produce a "tick" (the silly_test test should fail). The neotest test output shows that no tests have been run, however, running with vim-test's TestFile correctly runs the tests and shows the failed test.

fn silly_function() {}

#[cfg(test)]
mod tests {

    #[test]
    fn silly_test() {
        assert!(false);
    }
}
rouge8 commented 2 years ago

I wrote a Rust plugin using cargo-nextest. That should fix your issue!

tomhampshire commented 2 years ago

Awesome, thanks. I'm running it now and it's doing the job great!

rcarriga commented 2 years ago

For other people that could see this, it should be working now. Issue was that vim-test uses relative paths whereas neotest uses absolute paths.