feat: 添加测试框架及功能测试用例
test: 实现BDD测试框架及功能测试 docs: 添加测试配置文件及文档 refactor: 重构命令处理逻辑以支持测试
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
Feature: /switch command — activate a different session
|
||||
|
||||
Background:
|
||||
Given user "user_abc123" is sending commands
|
||||
|
||||
Scenario: No sessions returns error
|
||||
When user sends "/switch 1"
|
||||
Then reply contains "No sessions available"
|
||||
|
||||
Scenario: Valid switch updates active session
|
||||
Given user has session "sess01" in "/tmp/proj1"
|
||||
And user has session "sess02" in "/tmp/proj2"
|
||||
When user sends "/switch 2"
|
||||
Then reply contains "Switched to session"
|
||||
And active session for user "user_abc123" is "sess02"
|
||||
|
||||
Scenario: Out of range number returns error
|
||||
Given user has session "sess01" in "/tmp/proj1"
|
||||
When user sends "/switch 5"
|
||||
Then reply contains "Invalid session number"
|
||||
|
||||
Scenario: Non-numeric argument returns error
|
||||
Given user has session "sess01" in "/tmp/proj1"
|
||||
When user sends "/switch notanumber"
|
||||
Then reply contains "Invalid number"
|
||||
|
||||
Scenario: Missing argument shows usage
|
||||
Given user has session "sess01" in "/tmp/proj1"
|
||||
When user sends "/switch"
|
||||
Then reply contains "Usage: /switch"
|
||||
Reference in New Issue
Block a user