SafeDatabaseName returns a database name free of any special characters for use in tests.
(t *testing.T, name string)
| 2782 | |
| 2783 | // SafeDatabaseName returns a database name free of any special characters for use in tests. |
| 2784 | func SafeDatabaseName(t *testing.T, name string) string { |
| 2785 | dbName := strings.ToLower(name) |
| 2786 | for _, c := range []string{" ", "<", ">", "/", "="} { |
| 2787 | dbName = strings.ReplaceAll(dbName, c, "_") |
| 2788 | } |
| 2789 | return dbName |
| 2790 | } |
| 2791 | |
| 2792 | // SafeDocumentName returns a document name free of any special characters for use in tests. |
| 2793 | func SafeDocumentName(t *testing.T, name string) string { |
no outgoing calls