Unify magic env var name

This commit is contained in:
Aleksey Kladov 2020-07-01 12:31:03 +02:00
parent 7b0113b3d5
commit 991850bc3c
2 changed files with 3 additions and 3 deletions

View file

@ -274,7 +274,7 @@ fn assert_equal_text(expected: &str, actual: &str, path: &Path) {
fs::write(path, actual).unwrap();
return;
}
if env::var("UPDATE_EXPECTATIONS").is_ok() {
if env::var("UPDATE_EXPECT").is_ok() {
println!("rewriting {}", pretty_path.display());
fs::write(path, actual).unwrap();
return;

View file

@ -361,10 +361,10 @@ There are two kinds of tests:
The purpose of inline tests is not to achieve full coverage by test cases, but to explain to the reader of the code what each particular `if` and `match` is responsible for.
If you are tempted to add a large inline test, it might be a good idea to leave only the simplest example in place, and move the test to a manual `parser/ok` test.
To update test data, run with `UPDATE_EXPECTATIONS` variable:
To update test data, run with `UPDATE_EXPECT` variable:
```bash
env UPDATE_EXPECTATIONS=1 cargo qt
env UPDATE_EXPECT=1 cargo qt
```
After adding a new inline test you need to run `cargo xtest codegen` and also update the test data as described above.