Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/cortex-cli/src/agent_cmd/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
#[cfg(test)]
mod tests {
use crate::agent_cmd::cli::{CopyArgs, ExportArgs};
use crate::agent_cmd::loader::{
load_builtin_agents, parse_frontmatter, read_file_with_encoding,
};
use crate::agent_cmd::loader::{load_builtin_agents, parse_frontmatter};
use crate::agent_cmd::types::AgentMode;
use crate::utils::file::read_file_with_encoding;

#[test]
fn test_read_file_with_utf8() {
Expand Down
13 changes: 13 additions & 0 deletions src/cortex-cli/src/compact_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub struct CompactCli {
#[derive(Debug, clap::Subcommand)]
pub enum CompactSubcommand {
/// Run a compaction cycle (logs + sessions)
#[command(visible_alias = "exec")]
Run(CompactRunArgs),

/// Prune old log files
Expand Down Expand Up @@ -732,13 +733,25 @@ use cortex_compact::AutoCompactionConfig;
#[cfg(test)]
mod tests {
use super::*;
use clap::Parser;
use std::fs;
use tempfile::tempdir;

// ========================================================================
// format_size tests
// ========================================================================

#[test]
fn test_compact_run_exec_alias() {
let cli = CompactCli::try_parse_from(["compact", "exec", "--dry-run"])
.expect("compact exec should parse as run alias");

match cli.subcommand {
Some(CompactSubcommand::Run(args)) => assert!(args.dry_run),
other => panic!("expected run subcommand, got {other:?}"),
}
}

#[test]
fn test_format_size_bytes() {
assert_eq!(format_size(0), "0 B");
Expand Down