aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tools.rs
diff options
context:
space:
mode:
authorsalmonik <salmon@2137697.xyz>2026-11-22 18:58:26 +0100
committersalmonik <salmon@2137697.xyz>2026-11-22 18:58:26 +0100
commit7c035acc6e282cdbaa3b0060a528660fa0dba0d4 (patch)
tree0998222677041f58b2759adc99d3515b8db2d404 /tests/tools.rs
parent0.12.0: provider is a type + URL, plus a config file (diff)
downloadagent686-7c035acc6e282cdbaa3b0060a528660fa0dba0d4.tar.gz
agent686-7c035acc6e282cdbaa3b0060a528660fa0dba0d4.zip
0.12.1: accept `command` as an alias for `cmd` in bash
A field report showed ~40% of bash calls died on a one-word slip (command vs cmd); the alias removes the failure class instead of improving the error for it.
Diffstat (limited to '')
-rw-r--r--tests/tools.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tools.rs b/tests/tools.rs
index 4a8176e..0321bf8 100644
--- a/tests/tools.rs
+++ b/tests/tools.rs
@@ -517,3 +517,16 @@ fn a_pipeline_that_exceeds_the_file_limit_is_reported() {
517 "should report the file limit: {text}" 517 "should report the file limit: {text}"
518 ); 518 );
519} 519}
520
521#[test]
522fn bash_accepts_command_as_an_alias_for_cmd() {
523 use agent686::tools::validate;
524
525 assert!(validate("bash", &json!({ "command": "ls" })).is_ok());
526 assert!(validate("bash", &json!({ "command": " " })).is_err());
527 assert!(validate("bash", &json!({})).is_err());
528
529 let text = run("bash", &json!({ "command": "echo alias-works" })).unwrap();
530 assert!(text.contains("alias-works"), "{text}");
531 assert!(text.contains("[exit 0]"), "{text}");
532}