Open alanz opened 3 years ago
@alanz please check this section: https://rust-analyzer.github.io/manual.html#setting-runnable-environment-variables, you can set env variables manually
you can set env variables manually
Perhaps I am doing it wrong, but I find I change code, then a test fails. I need to inspect the diff presented by expect-test to decide if it is an acceptable change, or if it is flagging a problem.
Setting UPDATE_EXPECT=1
always basically negates the usefulness of the tests, as it just silently updates them.
So I would like to be able to run a test with the flag off, see the result, and have an easy option to accept it by running it with the flag on.
I see there is some support for setting UPDATE_EXPECT=1 already, added in #5101. I'm not sure how to use it though.
I'm not sure how to use it though.
In emacs, with lsp-mode, put your cursor on an expect!
macro in the test, then M-x lsp-rust-analyzer-run
should give an option to run with update expect. See https://github.com/emacs-lsp/lsp-mode/pull/3597
If a test uses an expect-test assertion, add an additional code lens to run the test with
UPDATE_EXPECT
set to 1, so the test gets updated.