(t *testing.T)
| 1145 | } |
| 1146 | |
| 1147 | func TestFeatureFlagError(t *testing.T) { |
| 1148 | tools := []ServerTool{ |
| 1149 | mockToolWithFlags("needs_flag", "toolset1", true, "my_feature", ""), |
| 1150 | } |
| 1151 | |
| 1152 | // Checker that returns error should treat as false (tool excluded) |
| 1153 | checkerError := func(_ context.Context, _ string) (bool, error) { |
| 1154 | return false, fmt.Errorf("simulated error") |
| 1155 | } |
| 1156 | reg := mustBuild(t, NewBuilder().SetTools(tools).WithFeatureChecker(checkerError)) |
| 1157 | available := reg.AvailableTools(context.Background()) |
| 1158 | if len(available) != 0 { |
| 1159 | t.Errorf("Expected 0 tools when checker errors, got %d", len(available)) |
| 1160 | } |
| 1161 | } |
| 1162 | |
| 1163 | func TestFeatureFlagResources(t *testing.T) { |
| 1164 | resources := []ServerResourceTemplate{ |
nothing calls this directly
no test coverage detected