Commit f03df6a
committed
test(recipes): assert recorded-ness separately from the recorded mode
Review on #2328: comparing the mode alone conflated two states. An absent
configuration and a configuration that is present but carries an empty
mode both yield "", so a regression producing the latter would have passed
as the former. That is the ambiguous-presence-check anti-pattern the repo
guidance calls out.
Switched to RuntimeInventoryMode()'s two return values and assert presence
and value separately. Mutation-verified: making the accessor report an
absent configuration as present fails the new assertion.
Worth noting the present-but-empty state is not reachable through the
public API today, since the only writer sets Mode from a validated parse.
This guards a future regression rather than a current defect.
Signed-off-by: Mark Chmarny <mark@chmarny.com>1 parent 0162201 commit f03df6a
1 file changed
Lines changed: 18 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| |||
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
117 | 124 | | |
118 | 125 | | |
119 | 126 | | |
| |||
0 commit comments