untested

package module
v0.0.0-...-56a68cd Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

go-untested

go-untested lists untested functions in the package(s).

Example

$ go-untested -verbose ./...
func IsExported(fn Func) bool
func Analyze(pkgs map[string]Pkg) (tested []Func, untested []Func)
func IsGeneratedFile(file *ast.File) bool
func HasNoTestComment(decl *ast.FuncDecl) bool

CLI

Usage of go-untested:
  -generated
        show untested generated funcs
  -private
        show untested unexported funcs
  -tested
        show tested funcs
  -verbose
        show full func names

Documentation

Index

Constants

View Source
const (
	NoTestDirective = "//notest"
	TestPkgSuffix   = "_test"
)

Variables

This section is empty.

Functions

func Analyze

func Analyze(pkgs map[string]Pkg) (tested []Func, untested []Func)

func HasNoTestComment

func HasNoTestComment(decl *ast.FuncDecl) bool

func IsExported

func IsExported(fn Func) bool

func IsGeneratedFile

func IsGeneratedFile(file *ast.File) bool

check if it's a generated file

Types

type Func

type Func struct {
	Name        string
	VerboseName string
}

type Pkg

type Pkg struct {
	Name  string
	Funcs []Func
	Tests []Func
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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