mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-05 23:54:50 +08:00
test: cover new CLI slash command handlers
This commit is contained in:
@@ -510,6 +510,29 @@ mod tests {
|
||||
SlashCommand::parse("/compact now"),
|
||||
Some(SlashCommand::Compact)
|
||||
);
|
||||
assert_eq!(
|
||||
SlashCommand::parse("/model claude-sonnet"),
|
||||
Some(SlashCommand::Model {
|
||||
model: Some("claude-sonnet".into()),
|
||||
})
|
||||
);
|
||||
assert_eq!(
|
||||
SlashCommand::parse("/permissions workspace-write"),
|
||||
Some(SlashCommand::Permissions {
|
||||
mode: Some("workspace-write".into()),
|
||||
})
|
||||
);
|
||||
assert_eq!(
|
||||
SlashCommand::parse("/config hooks"),
|
||||
Some(SlashCommand::Config {
|
||||
section: Some("hooks".into()),
|
||||
})
|
||||
);
|
||||
assert_eq!(SlashCommand::parse("/memory"), Some(SlashCommand::Memory));
|
||||
assert_eq!(
|
||||
SlashCommand::parse("/clear --confirm"),
|
||||
Some(SlashCommand::Clear { confirm: true })
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -521,6 +544,11 @@ mod tests {
|
||||
assert!(output.contains("/help"));
|
||||
assert!(output.contains("/status"));
|
||||
assert!(output.contains("/compact"));
|
||||
assert!(output.contains("/model [model]"));
|
||||
assert!(output.contains("/permissions [mode]"));
|
||||
assert!(output.contains("/config [section]"));
|
||||
assert!(output.contains("/memory"));
|
||||
assert!(output.contains("/clear [--confirm]"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user