forked from forgejo/forgejo
Backport #26346
Follow the CLI refactoring, and add tests.
(cherry picked from commit fa431b377d
)
This commit is contained in:
parent
149cd865ea
commit
2e539d5190
4 changed files with 104 additions and 4 deletions
|
@ -16,3 +16,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 }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue