mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 21:49:22 +00:00
19 lines
317 B
Go
19 lines
317 B
Go
|
// Copyright 2024 The Forgejo Authors
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
package test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestMockProtect(t *testing.T) {
|
||
|
mockable := "original"
|
||
|
restore := MockProtect(&mockable)
|
||
|
mockable = "tainted"
|
||
|
restore()
|
||
|
assert.Equal(t, "original", mockable)
|
||
|
}
|