Commit 76d489e
committed
Fix ReadOnlyZipStoreTest failures due to inconsistent ZIP entry paths and directory existence
- Problem:
* Some tests failed because ReadOnlyZipStore could not locate ZIP entries when the store
was created by simply zipping a directory. Tools differ: some produce entry names with
a leading slash, others without. This caused getInputStream(), read(), and getSize() to return null.
* testExists() failed for root keys because exists() included directories, but by design it should only test file existence.
- Solution:
* Added resolvePathWithLeadingSlashFromKeys() to try a secondary lookup with a leading slash.
Primary lookup uses the standard key without leading slash; secondary is only for compatibility.
* Modified exists(String[] keys) to check only fileSizeIndex, ignoring directories, to match the intended design.
- Effect:
* ReadOnlyZipStoreTest passes regardless of whether ZIP entries have leading slashes or not.
* Test logic now clearly distinguishes between file existence and directory entries.1 parent 8c6511f commit 76d489e
1 file changed
Lines changed: 24 additions & 3 deletions
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
| |||
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
221 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
| |||
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
248 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
| |||
423 | 435 | | |
424 | 436 | | |
425 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
426 | 442 | | |
427 | 443 | | |
428 | 444 | | |
| |||
527 | 543 | | |
528 | 544 | | |
529 | 545 | | |
530 | | - | |
| 546 | + | |
531 | 547 | | |
532 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
533 | 554 | | |
534 | 555 | | |
535 | 556 | | |
| |||
0 commit comments