| 1 |
//go:build create_regression_data |
| 2 |
|
| 3 |
package oidc |
| 4 |
|
| 5 |
import ( |
| 6 |
"os" |
| 7 |
"testing" |
| 8 |
|
| 9 |
"github.com/stretchr/testify/require" |
| 10 |
) |
| 11 |
|
| 12 |
// Test_create_regression generates the regression data. |
| 13 |
// It is excluded from regular testing, unless |
| 14 |
// called with the create_regression_data tag: |
| 15 |
// go test -tags="create_regression_data" ./pkg/oidc |
| 16 |
func Test_create_regression(t *testing.T) { |
| 17 |
for _, obj := range regressionData { |
| 18 |
file, err := os.Create(jsonFilename(obj)) |
| 19 |
require.NoError(t, err) |
| 20 |
defer file.Close() |
| 21 |
|
| 22 |
encodeJSON(t, file, obj) |
| 23 |
} |
| 24 |
} |