Commit b3b6f00
committed
preprocessor: fix comparator regex for column-aligned stats output
The patternComparator for the log-statistics-from-the-cue-evaluator page
used the regex (?m)\d+,?$ which only normalizes digits at line ends. CUE
evaluator stats use right-aligned columns, so when numbers change digit
count between runs the whitespace padding before them also changes. This
caused the comparator to fail, rewriting the page on every run when
Preprocessor-No-Write-Cache was set.
Change the regex to (?m)\s+\d+,?$ so that both the whitespace padding
and the digits are normalized together, correctly handling column
alignment differences.
Add a test that verifies comparators handle column-aligned output with
different digit counts when --nowritecache is set with a cache miss.
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: Ifdec2fbafcf3d013bcffa09a8024d0af4417869c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1232616
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>1 parent baccf64 commit b3b6f00
File tree
2 files changed
+88
-1
lines changed- content/docs/howto/log-statistics-from-the-cue-evaluator
- internal/cmd/preprocessor/cmd/testdata
2 files changed
+88
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
Lines changed: 87 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
0 commit comments