neotest icon indicating copy to clipboard operation
neotest copied to clipboard

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

Open tomhampshire opened this issue 3 years ago • 2 comments

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);
    }
}

tomhampshire avatar Jul 23 '22 17:07 tomhampshire

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

rouge8 avatar Jul 26 '22 02:07 rouge8

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

tomhampshire avatar Jul 26 '22 17:07 tomhampshire

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.

rcarriga avatar Sep 13 '22 08:09 rcarriga