Movatterモバイル変換


[0]ホーム

URL:


testenv

package
v1.92.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:3Imported by:10

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package testenv provides utility functions for tests. It does not depend onthe `testing` package to allow usage in non-test code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcAssertInTestadded inv1.84.0

func AssertInTest()

AssertInTest panics if called outside of a test binary.

funcInParallelTestadded inv1.84.0

func InParallelTest(tTB) (isParallelbool)

InParallelTest reports whether t is running as a parallel test.

Use of this function taints t such that its Parallel method (assuming t is anactual *testing.T) will panic if called after this function.

funcInTest

func InTest()bool

InTest reports whether the current binary is a test binary.

Types

typeTBadded inv1.84.0

type TB interface {Cleanup(func())Error(args ...any)Errorf(formatstring, args ...any)Fail()FailNow()Failed()boolFatal(args ...any)Fatalf(formatstring, args ...any)Helper()Log(args ...any)Logf(formatstring, args ...any)Name()stringSetenv(key, valuestring)Chdir(dirstring)Skip(args ...any)SkipNow()Skipf(formatstring, args ...any)Skipped()boolTempDir()stringContext()context.Context}

TB is testing.TB, to avoid importing "testing" in non-test code.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp