diff options
Diffstat (limited to 'tests/sessions.rs')
| -rw-r--r-- | tests/sessions.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/sessions.rs b/tests/sessions.rs index 748b689..b381888 100644 --- a/tests/sessions.rs +++ b/tests/sessions.rs | |||
| @@ -159,7 +159,9 @@ fn last_reply_prefers_content_and_falls_back_to_reasoning() { | |||
| 159 | .append(&json!({ "role": "assistant", "content": null }), Some("only thinking")) | 159 | .append(&json!({ "role": "assistant", "content": null }), Some("only thinking")) |
| 160 | .unwrap(); | 160 | .unwrap(); |
| 161 | 161 | ||
| 162 | let reply = session::last_reply("reply").expect("there is a reply"); | 162 | drop(session); |
| 163 | let (opened, _system, _messages) = Session::open("reply").expect("open"); | ||
| 164 | let reply = opened.last_reply.expect("there is a reply"); | ||
| 163 | assert_eq!(reply.content, "the answer", "prefers a real block"); | 165 | assert_eq!(reply.content, "the answer", "prefers a real block"); |
| 164 | assert_eq!(reply.reasoning, "the thinking", "and its own reasoning"); | 166 | assert_eq!(reply.reasoning, "the thinking", "and its own reasoning"); |
| 165 | 167 | ||
| @@ -168,7 +170,9 @@ fn last_reply_prefers_content_and_falls_back_to_reasoning() { | |||
| 168 | session | 170 | session |
| 169 | .append(&json!({ "role": "assistant", "content": null }), Some("thoughts")) | 171 | .append(&json!({ "role": "assistant", "content": null }), Some("thoughts")) |
| 170 | .unwrap(); | 172 | .unwrap(); |
| 171 | let reply = session::last_reply("reasoning-only").unwrap(); | 173 | drop(session); |
| 174 | let (opened, _system, _messages) = Session::open("reasoning-only").unwrap(); | ||
| 175 | let reply = opened.last_reply.unwrap(); | ||
| 172 | assert!(reply.content.is_empty()); | 176 | assert!(reply.content.is_empty()); |
| 173 | assert_eq!(reply.reasoning, "thoughts"); | 177 | assert_eq!(reply.reasoning, "thoughts"); |
| 174 | } | 178 | } |
