MCPcopy Create free account
hub / github.com/diillson/chatcli / TestAddRule_RejectsLongPattern

Function TestAddRule_RejectsLongPattern

cli/coder/policy_manager_test.go:87–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestAddRule_RejectsLongPattern(t *testing.T) {
88 pm := &PolicyManager{
89 Rules: []Rule{},
90 logger: zap.NewNop(),
91 }
92 longPattern := strings.Repeat("x", 501)
93 err := pm.AddRule(longPattern, ActionAllow)
94 assert.Error(t, err)
95 assert.Contains(t, err.Error(), "too long")
96}
97
98func TestDeleteRule_RoundtripAndIdempotent(t *testing.T) {
99 tmp := t.TempDir()

Callers

nothing calls this directly

Calls 2

AddRuleMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected