MCPcopy Create free account
hub / github.com/astercloud/aster / TestIsAppKey

Function TestIsAppKey

pkg/session/session_test.go:94–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestIsAppKey(t *testing.T) {
95 tests := []struct {
96 key string
97 expected bool
98 }{
99 {"app:setting1", true},
100 {"app:", false}, // 长度不够
101 {"user:setting1", false},
102 {"temp:setting1", false},
103 {"session:setting1", false},
104 {"setting1", false},
105 }
106
107 for _, tt := range tests {
108 t.Run(tt.key, func(t *testing.T) {
109 result := IsAppKey(tt.key)
110 if result != tt.expected {
111 t.Errorf("IsAppKey(%q) = %v, expected %v", tt.key, result, tt.expected)
112 }
113 })
114 }
115}
116
117func TestIsUserKey(t *testing.T) {
118 tests := []struct {

Callers

nothing calls this directly

Calls 2

IsAppKeyFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected