testsupport

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testsupport holds helpers shared by Kivgraph tests. It is not imported by production code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireRustAnalyzer

func RequireRustAnalyzer(t testing.TB)

RequireRustAnalyzer skips the test unless this machine can actually run rust-analyzer.

Presence on PATH does not answer that. rustup installs a proxy named rust-analyzer for every toolchain, whether or not the component behind it was ever added, and that proxy exits with "Unknown binary 'rust-analyzer' in official toolchain". A guard that only looks the name up reports the analyzer as installed on any machine with rustup, so the tests run and fail instead of skipping — which is exactly what a hosted runner without `rustup component add rust-analyzer` looks like.

Running `--version` is the cheapest question whose answer is the one the caller needs.

func RequireSpaceOrSkip

func RequireSpaceOrSkip(t *testing.T, err error)

RequireSpaceOrSkip turns the one failure that belongs to the host rather than to the code under test into a skip.

Publishing a generation refuses a filesystem that is more than 85% full, whatever the size of the database, so on such a host a test that needs a published generation never reaches the behaviour it asserts. The policy itself is covered by the generation package, which builds its store with an explicit one.

func TempDir

func TempDir(t testing.TB) string

TempDir returns a per-test temporary directory whose path contains no symlink component.

Repository path validation rejects a path with a symlinked ancestor, and that policy is deliberate. On macOS the directory returned by t.TempDir() lives under /var/folders and /var is a symlink to /private/var, so a test that feeds t.TempDir() to the workspace layer exercises the rejection instead of the behaviour under test. Resolving the realpath here keeps the production policy untouched.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL