taskfill

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package taskfill builds a pm.Task with every exported field set, for tests that must notice when a store drops one (Task 20361).

statedb enumerated plan_tasks' columns by hand, and fourteen pm.Task fields were never among them: an assignee, a sprint, a plan's on_success branches all read back as zero after the next load. Nothing noticed, because every test that checked persistence named the fields it set — and a field nobody knew was missing is the one nobody sets. A test built on Task instead covers every field, including the next one somebody adds, and fails until the store keeps it or the test is told why it does not.

Values are distinct per field and per task number, so a store that wrote one field's value into another's column fails too, not only one that drops it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(want, got *pm.Task, skip ...string) []string

Diff returns the exported fields of pm.Task whose values differ between want and got, in declaration order, leaving out the fields named in skip.

Values are compared the way a store can faithfully return them: times as instants (a database hands back the same moment in another location), and a nil slice as equal to an empty one (JSON's null and [] both mean "none").

func Fields

func Fields() []string

Fields returns the names of pm.Task's exported fields, in declaration order.

func Task

func Task(id int) *pm.Task

Task returns a task numbered id whose every other exported field holds a non-zero value that no other field shares, recursing into slices, pointers and nested structs. Times are in UTC.

It panics on a field kind it does not know how to fill, naming the field: that is a new pm.Task field this package has to learn about, and a test that silently left it zero would be the gap this package exists to close.

Types

This section is empty.

Jump to

Keyboard shortcuts

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