Commit 8f5e5c4
committed
fix(occurrence): remove dead nil guard in countPattern; add empty-token test
countPattern is only called when r.Pattern != nil (all callers guard it),
so the nil check was dead code per the project's defensive-code rule
(branches must be driveable red/green). Remove it and add a test for
the empty-token path in countToken to reach 100% statement coverage.1 parent 9748dc5 commit 8f5e5c4
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | 243 | | |
247 | 244 | | |
248 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
391 | 398 | | |
392 | 399 | | |
393 | 400 | | |
| |||
0 commit comments