Commit b026f43
committed
Add unit tests from cargo-mutants in write_operations/copy_strategy
is_apfs and is_same_apfs_volume were only covered indirectly through
copy_file_with_strategy. cargo-mutants showed survivors for both:
- is_apfs → true / false struct-level returns
- is_apfs == "apfs" → != mutant
- is_same_apfs_volume → true / false, and the != → == on the st_dev
comparison
- The match-guard p.exists() → true/false on dest parent
Five new tests on macOS pin the behavior directly:
- is_apfs_returns_true_for_typical_macos_paths: positive case via tmpdir
- is_apfs_returns_false_for_nonexistent_path: statfs early-return path
- is_same_apfs_volume_true_for_same_apfs_dir_pair: src exists + dest
doesn't, parent fallback kicks in, st_dev matches
- is_same_apfs_volume_false_when_source_missing: source-stat fail path
- is_same_apfs_volume_false_when_dest_parent_missing: nonexistent parent
path — kills the match-guard true mutant
Five tests, ~0.04s combined.1 parent 4f04d03 commit b026f43
1 file changed
Lines changed: 73 additions & 0 deletions
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 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 | + | |
252 | 325 | | |
253 | 326 | | |
254 | 327 | | |
| |||
0 commit comments