1
0

完成一个简易的全局skill、command管理器

This commit is contained in:
2026-02-25 14:33:56 +08:00
parent f4cb809f9d
commit 2d327b5af8
60 changed files with 6053 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
package prompt
import (
"strings"
"testing"
)
func TestConfirmWithReader_Yes(t *testing.T) {
tests := []string{"y", "Y", "yes", "YES", "Yes"}
for _, input := range tests {
reader := strings.NewReader(input + "\n")
result := ConfirmWithReader("测试?", reader)
if !result {
t.Errorf("输入 '%s' 应返回 true", input)
}
}
}
func TestConfirmWithReader_No(t *testing.T) {
tests := []string{"n", "N", "no", "NO", "No", "", "anything"}
for _, input := range tests {
reader := strings.NewReader(input + "\n")
result := ConfirmWithReader("测试?", reader)
if result {
t.Errorf("输入 '%s' 应返回 false", input)
}
}
}