Commit ef91cfb
committed
Add unit tests from cargo-mutants in indexing/store
platform_case_compare backs the SQLite `platform_case` collation that
every path-resolution query relies on. The only existing test was the
macOS happy-path checking that "Users", "users", and "USERS" all
resolve to the same row — but that doesn't catch the mutant where
platform_case_compare always returns Ordering::Equal
(the Default::default() replacement), because every name-vs-name
comparison would still be Equal, including across distinct entries.
Six new tests directly exercise the private collation:
macOS (case-insensitive, NFD-normalizing):
- platform_case_compare_distinguishes_distinct_names: pin Less/Greater
for a-vs-b and b-vs-a — kills the Default::default() mutant.
- platform_case_compare_case_insensitive_on_macos: "Users" == "users"
and "README.MD" == "readme.md".
- platform_case_compare_normalizes_unicode_nfc_to_nfd: NFC "café" and
NFD "cafe + combining acute" compare equal — pins the APFS-matching
normalization step.
- normalize_for_comparison_lowercases_and_nfd_normalizes: NFC and NFD
produce the same normalized form, output is non-empty for non-empty
input — kills the empty/sentinel replacement mutants.
Linux/other (binary):
- platform_case_compare_is_binary_off_macos: 'U' < 'u' so "Users" >
"users" — pins the cfg-gated identity path.
- normalize_for_comparison_is_identity_off_macos: returns the input
string unchanged.
Plus a trailing-blank-line cleanup in watcher_test.rs (rustfmt).1 parent a812cd9 commit ef91cfb
2 files changed
Lines changed: 82 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | 193 | | |
195 | 194 | | |
196 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2163 | 2163 | | |
2164 | 2164 | | |
2165 | 2165 | | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
2166 | 2248 | | |
2167 | 2249 | | |
2168 | 2250 | | |
| |||
0 commit comments