blob: a3be74ee94bbe86aa590dc44754b64ef44daded9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// 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)
}
|