SafeDocumentName returns a document name free of any special characters for use in tests.
(t *testing.T, name string)
| 1014 | |
| 1015 | // SafeDocumentName returns a document name free of any special characters for use in tests. |
| 1016 | func SafeDocumentName(t *testing.T, name string) string { |
| 1017 | docName := strings.ToLower(name) |
| 1018 | for _, c := range []string{" ", "<", ">", "/", "="} { |
| 1019 | docName = strings.ReplaceAll(docName, c, "_") |
| 1020 | } |
| 1021 | require.Less(t, len(docName), 251, "Document name %s is too long, must be less than 251 characters", name) |
| 1022 | return docName |
| 1023 | } |