mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-07 00:24:50 +08:00
Merge branch 'dori/commands-parity' into main
This commit is contained in:
@@ -22,7 +22,8 @@ use api::{
|
||||
|
||||
use commands::{
|
||||
handle_agents_slash_command, handle_plugins_slash_command, handle_skills_slash_command,
|
||||
render_slash_command_help, resume_supported_slash_commands, slash_command_specs, SlashCommand,
|
||||
render_slash_command_help, resume_supported_slash_commands, slash_command_specs,
|
||||
validate_slash_command_input, SlashCommand,
|
||||
};
|
||||
use compat_harness::{extract_manifest, UpstreamPaths};
|
||||
use init::initialize_repo;
|
||||
@@ -5185,6 +5186,23 @@ mod tests {
|
||||
assert!(error.contains("claw --resume SESSION.jsonl /status"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn direct_slash_commands_surface_shared_validation_errors() {
|
||||
let compact_error = parse_args(&["/compact".to_string(), "now".to_string()])
|
||||
.expect_err("invalid /compact shape should be rejected");
|
||||
assert!(compact_error.contains("Unexpected arguments for /compact."));
|
||||
assert!(compact_error.contains("Usage /compact"));
|
||||
|
||||
let plugins_error = parse_args(&[
|
||||
"/plugins".to_string(),
|
||||
"list".to_string(),
|
||||
"extra".to_string(),
|
||||
])
|
||||
.expect_err("invalid /plugins list shape should be rejected");
|
||||
assert!(plugins_error.contains("Usage: /plugin list"));
|
||||
assert!(plugins_error.contains("Aliases /plugins, /marketplace"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn formats_unknown_slash_command_with_suggestions() {
|
||||
let report = format_unknown_slash_command_message("stats");
|
||||
|
||||
Reference in New Issue
Block a user