mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-22 08:51:41 +00:00

For future in-memory network changes (#15558) to be able to be stricter and do automatic leak detection when it's safe to do so, in non-parallel tests. Updates tailscale/corp#27636 Change-Id: I50f03b16a3f92ce61a7ed88264b49d8c6628f638 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
32 lines
611 B
Go
32 lines
611 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package testenv
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"tailscale.com/tstest/deptest"
|
|
)
|
|
|
|
func TestDeps(t *testing.T) {
|
|
deptest.DepChecker{
|
|
BadDeps: map[string]string{
|
|
"testing": "see pkg docs",
|
|
},
|
|
}.Check(t)
|
|
}
|
|
|
|
func TestInParallelTestTrue(t *testing.T) {
|
|
t.Parallel()
|
|
if !InParallelTest(t) {
|
|
t.Fatal("InParallelTest should return true once t.Parallel has been called")
|
|
}
|
|
}
|
|
|
|
func TestInParallelTestFalse(t *testing.T) {
|
|
if InParallelTest(t) {
|
|
t.Fatal("InParallelTest should return false before t.Parallel has been called")
|
|
}
|
|
}
|