Yuyao Huang (Sam) 8dab229aaf feat: 添加测试框架及功能测试用例
test: 实现BDD测试框架及功能测试
docs: 添加测试配置文件及文档
refactor: 重构命令处理逻辑以支持测试
2026-03-29 04:24:27 +08:00

23 lines
657 B
Gherkin

Feature: /shell command — run host shell commands
Background:
Given user "user_abc123" is sending commands
Scenario: No arguments shows usage
When user sends "/shell"
Then reply contains "Usage: /shell"
Scenario: Runs echo and returns output
When user sends "/shell echo hello"
Then reply contains "hello"
And reply contains "exit code: 0"
Scenario: Blocked dangerous command is rejected
When user sends "/shell rm -rf /"
Then reply contains "Blocked"
And reply does not contain "exit code"
Scenario: Non-zero exit code is reported
When user sends "/shell exit 1"
Then reply contains "exit code"