mirror of
https://github.com/instructkr/claude-code.git
synced 2026-04-06 11:18:51 +03:00
test: cover new CLI slash command handlers
This commit is contained in:
@@ -510,6 +510,29 @@ mod tests {
|
|||||||
SlashCommand::parse("/compact now"),
|
SlashCommand::parse("/compact now"),
|
||||||
Some(SlashCommand::Compact)
|
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]
|
#[test]
|
||||||
@@ -521,6 +544,11 @@ mod tests {
|
|||||||
assert!(output.contains("/help"));
|
assert!(output.contains("/help"));
|
||||||
assert!(output.contains("/status"));
|
assert!(output.contains("/status"));
|
||||||
assert!(output.contains("/compact"));
|
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]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user