@@ -547,84 +547,6 @@ func TestClaudeEngineAddsTmpByDefault(t *testing.T) {
547547 }
548548}
549549
550- func TestHasBashWildcardInTools (t * testing.T ) {
551- tests := []struct {
552- name string
553- tools map [string ]any
554- expected bool
555- }{
556- {
557- name : "nil tools" ,
558- tools : nil ,
559- expected : false ,
560- },
561- {
562- name : "empty tools (no bash key)" ,
563- tools : map [string ]any {},
564- expected : false ,
565- },
566- {
567- name : "bash with specific commands only" ,
568- tools : map [string ]any {
569- "bash" : []any {"git" , "echo" },
570- },
571- expected : false ,
572- },
573- {
574- name : "bash with wildcard *" ,
575- tools : map [string ]any {
576- "bash" : []any {"*" },
577- },
578- expected : true ,
579- },
580- {
581- name : "bash with colon-wildcard :*" ,
582- tools : map [string ]any {
583- "bash" : []any {":*" },
584- },
585- expected : true ,
586- },
587- {
588- name : "bash with wildcard mixed with other commands" ,
589- tools : map [string ]any {
590- "bash" : []any {"git" , "*" , "echo" },
591- },
592- expected : true ,
593- },
594- {
595- name : "bash with nil value (non-list — unrestricted)" ,
596- tools : map [string ]any {
597- "bash" : nil ,
598- },
599- expected : true ,
600- },
601- {
602- name : "bash with true value (non-list — unrestricted)" ,
603- tools : map [string ]any {
604- "bash" : true ,
605- },
606- expected : true ,
607- },
608- {
609- name : "no bash key at all" ,
610- tools : map [string ]any {
611- "edit" : nil ,
612- "github" : map [string ]any {},
613- },
614- expected : false ,
615- },
616- }
617-
618- for _ , tt := range tests {
619- t .Run (tt .name , func (t * testing.T ) {
620- result := hasBashWildcardInTools (tt .tools )
621- if result != tt .expected {
622- t .Errorf ("hasBashWildcardInTools(%v): expected %v, got %v" , tt .tools , tt .expected , result )
623- }
624- })
625- }
626- }
627-
628550func TestGenerateAllowedToolsComment (t * testing.T ) {
629551 engine := NewClaudeEngine ()
630552
0 commit comments