testfile

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 2 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 testfile tells test code from other code by each language's own convention, from the path alone (size, test_suite reuses it). Nothing is parsed or run. See https://cernly.dev/how/plugins/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(p string) bool

Is reports whether the repo path is test code by convention:

go:          *_test.go
ts/js:       *.test.*, *.spec.*, __tests__/
python:      test_*.py, *_test.py, conftest.py, tests/
java/kotlin: src/test/ (and Gradle's src/testFixtures/, src/integrationTest/),
             *Test.java, *Tests.java, *IT.java (and .kt, .groovy)
ruby:        *_spec.rb, *_test.rb, spec/
.NET:        *Test.cs, *Tests.cs (and .fs, .vb), a folder ending in .Tests,
             .UnitTests, .IntegrationTests or .Specs in any case; a path stand-in for
             the files of a test project, which the dotnet plugin reads
any:         a folder named test, tests, spec, e2e or testdata

func Language

func Language(p string) string

Language returns the language of a test file: Is, a source extension, and not under testdata (fixtures a test reads are not tests). "" otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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