Commit 82fc34f
authored
Improve golden file checking (#1053)
Currently when I have a typo in the golden file path, `expectGolden` creates a
new file, which makes the test pass.
Locally I can notice the new file if I run `git status`, but if I'm not careful
and rely on CI, because the tests pass, I can merge the PR.
Update `expectGolden` to only create (or update if already exists) a golden
file when the env variable `PROTOC_UPDATE_GOLDENS` is set.
Without the env variable it expects the file to exist, with the right contents.
So typos now cause test failures as expected.1 parent 456e2ee commit 82fc34f
1 file changed
+16
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 16 | + | |
| 17 | + | |
28 | 18 | | |
29 | 19 | | |
30 | | - | |
| 20 | + | |
31 | 21 | | |
32 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
33 | 31 | | |
34 | 32 | | |
0 commit comments