Commit e34a13c
committed
test(loader): cover resourceMatchesFile match + content-mismatch branches
PR #260 added LlamaLoader.resourceMatchesFile (the fast-path reuse predicate for
race-safe native-lib extraction) but unit-tested only the absent-resource -> false
branch. Add its two core branches:
- a present resource vs a byte-identical on-disk copy -> true (the reuse predicate itself), and
- a present resource whose on-disk copy diverges (one extra trailing byte) -> false, so a
stale/partial file is never mistaken for the shipped library on the reuse fast path.
Uses the committed /images/test-image.jpg test-classpath fixture; pure-Java, no model or
native library required. LlamaLoaderTest 25/25 green; Spotless clean.
The private extractFile/moveIntoPlace atomic-move + reuse flow stays covered end-to-end by
NativeLibraryLoadSmokeTest in the CI Java Tests jobs (needs the built native lib).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qg1mYW7hHjtVvAfMeMEmPq1 parent b5c36e7 commit e34a13c
1 file changed
Lines changed: 38 additions & 1 deletion
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
114 | 151 | | |
115 | 152 | | |
116 | 153 | | |
| |||
0 commit comments