testreport

package
v1.166.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 0 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 testreport is what a saved script version keeps of its tests (#1972): each test_* function's outcome at the save and the share of the version's statements the tests reach. It is its own package so a version record in pkg/script carries it without growing that package's public surface, and so the save gate that produces it and the store that keeps it share one type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coverage

type Coverage struct {
	Statements  int     `json:"statements" example:"140"`
	Covered     int     `json:"covered" example:"126"`
	Percent     float64 `json:"percent" example:"90"`
	MissedLines []int   `json:"missed_lines"`
}

Coverage is the statements the tests reach, and the lines of the ones they do not.

type Outcome

type Outcome struct {
	Name    string `json:"name" example:"test_empty_window"`
	Passed  bool   `json:"passed"`
	Line    int    `json:"line,omitempty" example:"120"`
	Failure string `json:"failure,omitempty"`
}

Outcome is one test_* function's result at the save.

type Report

type Report struct {
	Tests    []Outcome `json:"tests"`
	Passed   int       `json:"passed" example:"3"`
	Failed   int       `json:"failed" example:"0"`
	Coverage Coverage  `json:"coverage"`
}

Report is a saved version's tests.

Jump to

Keyboard shortcuts

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