Repository navigation
Commit 9decddb
test(vm): cover the two helper branches the coverage gate named
The per-function coverage ratchet (#734) failed this branch on both POSIX
lanes with exactly what it is for:
-- NEWLY BELOW 100% (2) --
internal/vm/method_reflect.go aliasBuiltinS 75.0% (was fully covered)
internal/vm/numeric_edges.go guardArgc 96.7% (was fully covered)
Both are in the new code, and neither is reachable from a call site, which
is why the local suite was green:
* aliasBuiltinS's panic arm. The panic test tabled aliasBuiltin and
defineBuiltinSecondName but not the two SINGLETON helpers, whose own
`if !ok` is a separate statement. Both are tabled now, which also pins
that the message names the right qualifier -- "Probe#absent" for an
instance method, "Probe.absent" for a singleton one.
* guardArgc's "this definition is already handled" skip. No current call
site reaches it: the one in numeric_edges.go lists imaginary, real and
rectangular, whose sharers (imag, rect) are not themselves in the list.
So it is tested directly rather than left to a future caller to find.
Double-wrapping would not break the guard, but it would leave the second
name pointing at a record the first no longer holds, which is the exact
identity defect this branch exists to fix -- so the test asserts the
shared definition and #original_name survive guarding both names.
The same test also pins that guardArgc SKIPS a name the table does not hold
rather than panicking, unlike the alias helpers: it is a post-hoc wrapper
over whatever was registered, and some registrations are platform-dependent
(fork/exec are absent under wasm). The two shapes differ on purpose.
Measured with the CI toolchain (go1.27.1, CGO_ENABLED=0): all six helpers --
aliasBuiltin, aliasBuiltinS, defineBuiltinSecondName,
defineBuiltinSecondNameS, secondNameIn, guardArgc -- at 100.0% from these
tests alone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent df43680 commit 9decddb
1 file changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| 274 | + | |
| 275 | + | |
272 | 276 | | |
273 | 277 | | |
274 | | - | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
281 | 288 | | |
282 | 289 | | |
283 | 290 | | |
| |||
288 | 295 | | |
289 | 296 | | |
290 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
0 commit comments