feat: 添加测试框架及功能测试用例

test: 实现BDD测试框架及功能测试
docs: 添加测试配置文件及文档
refactor: 重构命令处理逻辑以支持测试
This commit is contained in:
Yuyao Huang (Sam)
2026-03-29 04:24:27 +08:00
parent 6cf2143987
commit 8dab229aaf
22 changed files with 906 additions and 0 deletions
@@ -0,0 +1,27 @@
Feature: /direct and /smart mode toggle
Background:
Given user "user_abc123" is sending commands
Scenario: /direct requires active session
When user sends "/direct"
Then reply contains "No active session"
Scenario: /direct enables passthrough mode
Given user has session "sess01" in "/tmp/proj1"
And active session is "sess01"
When user sends "/direct"
Then reply contains "Direct mode ON"
And passthrough mode is enabled for user "user_abc123"
Scenario: /smart disables passthrough mode
Given user has session "sess01" in "/tmp/proj1"
And active session is "sess01"
And direct mode is enabled for user "user_abc123"
When user sends "/smart"
Then reply contains "Smart mode ON"
And passthrough mode is disabled for user "user_abc123"
Scenario: /smart always succeeds even without active session
When user sends "/smart"
Then reply contains "Smart mode ON"