Repository navigation
Commit b2f3da6
test: pin literal-type evaluation of marker chains in css-typing.ts
Add type-level assertions verifying that `marker(...).is.<relation>`
evaluates to the exact runtime selector string at the type level,
modulo the unknown hash slot (replaced with the literal `<HASH>`
placeholder by codegen-patch's renderMarkerTypes).
Coverage:
- call form (`marker("&:has(.flag-error)").is.ancestor`)
- underscore form on a registered condition
(`cardMarker._hover.is.{ancestor, descendant}`)
- all five relations (siblingBefore/siblingAfter/siblingAny)
- multi-`&` substitution
- parent-nesting condition value (anchor lands in leading position)
These are pure type-level checks: each constant assigns the chain
result to its expected literal string type. If the recursive
`BearbonesSubstituteAmp` type ever loses concreteness (e.g. widens
to `${string}` somewhere), one of these assignments fails and `tsc`
in the website build flags it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 472591e commit b2f3da6
2 files changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
78 | 132 | | |
79 | 133 | | |
80 | 134 | | |
| |||
0 commit comments