parityscan

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 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 parityscan is test support for the surface-parity contract around targetactivation plans.

Each activating surface declares which plan kinds it handles (`…HandlesPlanKind`) and separately dispatches them in a switch. The declaration is what the parity pair asserts against, so on its own it proves an intention rather than a behaviour: a kind added to the declaration but never given a branch would pass while a click on it did nothing. This package reads both out of the source and lets a surface require that they name exactly the same kinds, which is the cheapest way to make the two impossible to drift apart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandledKinds

func HandledKinds(t *testing.T, file, fn string) []string

HandledKinds returns the targetactivation.Plan* constants named by the case clauses of the switch inside fn, as it is written in file. The file path is relative to the package directory, which is where `go test` runs.

func RequireSameKinds

func RequireSameKinds(t *testing.T, surface string, declared, dispatched []string)

RequireSameKinds fails when a surface declares a kind it does not dispatch, or dispatches one it does not declare.

Types

This section is empty.

Jump to

Keyboard shortcuts

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