mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
25 lines
485 B
Go
25 lines
485 B
Go
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||
|
|
||
|
package tstest
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestReplace(t *testing.T) {
|
||
|
before := "before"
|
||
|
done := false
|
||
|
t.Run("replace", func(t *testing.T) {
|
||
|
Replace(t, &before, "after")
|
||
|
if before != "after" {
|
||
|
t.Errorf("before = %q; want %q", before, "after")
|
||
|
}
|
||
|
done = true
|
||
|
})
|
||
|
if !done {
|
||
|
t.Fatal("subtest didn't run")
|
||
|
}
|
||
|
if before != "before" {
|
||
|
t.Errorf("before = %q; want %q", before, "before")
|
||
|
}
|
||
|
}
|