File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33#[ cfg( test) ]
44mod tests {
55 use crate :: agent_cmd:: cli:: { CopyArgs , ExportArgs } ;
6- use crate :: agent_cmd:: loader:: {
7- load_builtin_agents, parse_frontmatter, read_file_with_encoding,
8- } ;
6+ use crate :: agent_cmd:: loader:: { load_builtin_agents, parse_frontmatter} ;
97 use crate :: agent_cmd:: types:: AgentMode ;
8+ use crate :: utils:: file:: read_file_with_encoding;
109
1110 #[ test]
1211 fn test_read_file_with_utf8 ( ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ pub struct CompactCli {
2929#[ derive( Debug , clap:: Subcommand ) ]
3030pub enum CompactSubcommand {
3131 /// Run a compaction cycle (logs + sessions)
32+ #[ command( visible_alias = "exec" ) ]
3233 Run ( CompactRunArgs ) ,
3334
3435 /// Prune old log files
@@ -732,13 +733,25 @@ use cortex_compact::AutoCompactionConfig;
732733#[ cfg( test) ]
733734mod tests {
734735 use super :: * ;
736+ use clap:: Parser ;
735737 use std:: fs;
736738 use tempfile:: tempdir;
737739
738740 // ========================================================================
739741 // format_size tests
740742 // ========================================================================
741743
744+ #[ test]
745+ fn test_compact_run_exec_alias ( ) {
746+ let cli = CompactCli :: try_parse_from ( [ "compact" , "exec" , "--dry-run" ] )
747+ . expect ( "compact exec should parse as run alias" ) ;
748+
749+ match cli. subcommand {
750+ Some ( CompactSubcommand :: Run ( args) ) => assert ! ( args. dry_run) ,
751+ other => panic ! ( "expected run subcommand, got {other:?}" ) ,
752+ }
753+ }
754+
742755 #[ test]
743756 fn test_format_size_bytes ( ) {
744757 assert_eq ! ( format_size( 0 ) , "0 B" ) ;
You can’t perform that action at this time.
0 commit comments