summaryrefslogtreecommitdiffstats
path: root/modules/test/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/test/utils.go')
-rw-r--r--modules/test/utils.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/test/utils.go b/modules/test/utils.go
index 2917741c45..4a0c2f1b3b 100644
--- a/modules/test/utils.go
+++ b/modules/test/utils.go
@@ -33,3 +33,9 @@ func RedirectURL(resp http.ResponseWriter) string {
func IsNormalPageCompleted(s string) bool {
return strings.Contains(s, `<footer class="page-footer"`) && strings.Contains(s, `</html>`)
}
+
+func MockVariableValue[T any](p *T, v T) (reset func()) {
+ old := *p
+ *p = v
+ return func() { *p = old }
+}