(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func TestIsBarrierFunction(t *testing.T) { |
| 140 | t.Parallel() |
| 141 | |
| 142 | ce := &customExecutor{ |
| 143 | barriers: map[string]struct{}{ |
| 144 | FinalyToolName: {}, |
| 145 | AskUserToolName: {}, |
| 146 | }, |
| 147 | } |
| 148 | |
| 149 | tests := []struct { |
| 150 | name string |
| 151 | toolName string |
| 152 | want bool |
| 153 | }{ |
| 154 | {name: "done is barrier", toolName: FinalyToolName, want: true}, |
| 155 | {name: "ask is barrier", toolName: AskUserToolName, want: true}, |
| 156 | {name: "terminal is not barrier", toolName: TerminalToolName, want: false}, |
| 157 | {name: "empty string is not barrier", toolName: "", want: false}, |
| 158 | } |
| 159 | |
| 160 | for _, tt := range tests { |
| 161 | t.Run(tt.name, func(t *testing.T) { |
| 162 | t.Parallel() |
| 163 | |
| 164 | if got := ce.IsBarrierFunction(tt.toolName); got != tt.want { |
| 165 | t.Errorf("IsBarrierFunction(%q) = %v, want %v", tt.toolName, got, tt.want) |
| 166 | } |
| 167 | }) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestGetBarrierToolNames(t *testing.T) { |
| 172 | t.Parallel() |
nothing calls this directly
no test coverage detected