diff options
Diffstat (limited to 'tests/cli.rs')
| -rw-r--r-- | tests/cli.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/cli.rs b/tests/cli.rs index 37546b1..faedb61 100644 --- a/tests/cli.rs +++ b/tests/cli.rs | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of agent686 | ||
| 3 | * Copyright (C) 2026 Salmonik <salmon@2137697.xyz> | ||
| 4 | * SPDX-License-Identifier: GPL-3.0-or-later | ||
| 5 | * https://git.2137697.xyz/agent686 | ||
| 6 | */ | ||
| 7 | |||
| 1 | use std::fs; | 8 | use std::fs; |
| 2 | use std::path::PathBuf; | 9 | use std::path::PathBuf; |
| 3 | use std::process::Command; | 10 | use std::process::Command; |
| @@ -52,10 +59,7 @@ fn session_ids_cannot_escape_the_sessions_directory() { | |||
| 52 | 59 | ||
| 53 | #[test] | 60 | #[test] |
| 54 | fn conflicting_flags_are_rejected() { | 61 | fn conflicting_flags_are_rejected() { |
| 55 | let output = agent() | 62 | let output = agent().args(["-c", "--session", "abc"]).output().unwrap(); |
| 56 | .args(["-c", "--session", "abc"]) | ||
| 57 | .output() | ||
| 58 | .unwrap(); | ||
| 59 | assert_eq!(output.status.code(), Some(2)); | 63 | assert_eq!(output.status.code(), Some(2)); |
| 60 | assert!(String::from_utf8_lossy(&output.stderr).contains("cannot be combined")); | 64 | assert!(String::from_utf8_lossy(&output.stderr).contains("cannot be combined")); |
| 61 | 65 | ||
| @@ -238,7 +242,11 @@ fn list_and_show_and_doctor_support_json() { | |||
| 238 | let body: String = lines.iter().map(|line| format!("{line}\n")).collect(); | 242 | let body: String = lines.iter().map(|line| format!("{line}\n")).collect(); |
| 239 | fs::write(sessions.join("demo.jsonl"), body).unwrap(); | 243 | fs::write(sessions.join("demo.jsonl"), body).unwrap(); |
| 240 | 244 | ||
| 241 | let list = agent().env("HOME", &home).args(["--list", "--json"]).output().unwrap(); | 245 | let list = agent() |
| 246 | .env("HOME", &home) | ||
| 247 | .args(["--list", "--json"]) | ||
| 248 | .output() | ||
| 249 | .unwrap(); | ||
| 242 | assert!(list.status.success(), "{list:?}"); | 250 | assert!(list.status.success(), "{list:?}"); |
| 243 | let list_json: serde_json::Value = serde_json::from_slice(&list.stdout).unwrap(); | 251 | let list_json: serde_json::Value = serde_json::from_slice(&list.stdout).unwrap(); |
| 244 | assert!(list_json.is_array()); | 252 | assert!(list_json.is_array()); |
