testreport

package
v1.138.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

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