contracttest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 5 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 contracttest checks log lines against the d108 contract in a test. It runs the logcheck binary of the private contract repo, found on PATH, and skips the test when the binary is not there, so a clone without it still passes go test:

lines := clitest.Raw(t)
t.Run("contract", func(t *testing.T) { contracttest.Check(t, lines) })

Put the call in its own subtest when other assertions follow it: a skip ends the test it is called in.

Index

Constants

View Source
const Install = "GOPRIVATE=github.com/AndreiD108/* go install github.com/AndreiD108/d108/logcheck/cmd/logcheck@v0.1.0"

Install is the command that puts logcheck on PATH.

Variables

This section is empty.

Functions

func Check

func Check(t testing.TB, lines [][]byte)

Check runs logcheck once over the lines, each ending in a newline, and fails t with its report when logcheck does not exit 0. Line numbers in the report count from 1 in the order of lines. Only a logcheck missing from PATH skips t.

Types

This section is empty.

Jump to

Keyboard shortcuts

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