Commit 39266bd
committed
test: restore PIT 100% (ChatTranscript.removePendingUserTurn) + jsonSchemaToGrammar guard
Fixes the mutation-coverage gate that PR #258 (audit correctness fixes) dropped to 97%.
- ChatTranscript.removePendingUserTurn() was added in #258 (for Session.cancelStream's
stream rollback) with zero test coverage. ChatTranscript is a PIT target class
(value.*), so all 6 of its mutants survived (NO_COVERAGE) → score 97% < 100% threshold,
failing the Ubuntu job. Add three ChatTranscriptTest cases — trailing user turn removed
(true + rolled back), assistant-ending round (false + intact), empty transcript
(false + no throw) — which kill all 6 mutants (2 NegateConditionals, 2 MathMutator,
the true/false return-value mutators).
- Add testJsonSchemaToGrammarRejectsMalformedSchema: a regression for the Tier 1
JNI exception-boundary fix. A malformed schema passed to the public static
LlamaModel.jsonSchemaToGrammar(String) used to let a C++ json::parse exception cross
the JNI boundary and abort the JVM; it must now surface as a catchable LlamaException.
(Model-gated by the class @BeforeAll, like the existing happy-path test, so it is
exercised in the CI Java Tests jobs.)
Verified locally: full configured PIT (mvn test-compile org.pitest:pitest-maven:mutationCoverage)
234/234 mutations killed (100%), BUILD SUCCESS; ChatTranscriptTest 15/15 green; Spotless clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qg1mYW7hHjtVvAfMeMEmPq1 parent 90f95d0 commit 39266bd
2 files changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
694 | 702 | | |
695 | 703 | | |
696 | 704 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 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 | + | |
112 | 150 | | |
113 | 151 | | |
114 | 152 | | |
| |||
0 commit comments