Documentation
¶
Overview ¶
Package deviations reads `testdata/deviations.json`, the register of accepted differences from a FoxIO value.
The register is data of this repository rather than of this library, and two test packages read it: `ja4plus` runs the conformance comparison, and `internal/repocheck` holds the register schema and the changelog counts. A test helper lives in a `_test.go` file, and no package imports another package's test files, so the reader lives here.
The reader stays out of the exported surface of the library. `v1.0.0` freezes that surface, and the register serves the test suite alone.
FR-reference-19 through FR-reference-24, FR-reference-27, FR-reference-28 and FR-reference-31 state the rules this package holds.
Index ¶
Constants ¶
const RegisterFile = "testdata/deviations.json"
RegisterFile is the path of the register, relative to the repository root.
Variables ¶
var CaptureSuffixes = []string{".pcap", ".pcapng"}
CaptureSuffixes names the two capture formats the Terms table defines.
var FieldNames = []string{"key", "capability", "ours", "theirs", "ruling", "reason"}
FieldNames names every field that FR-reference-20 requires.
var RulingPattern = regexp.MustCompile(`^#[1-9][0-9]*$`)
RulingPattern is the form of a `ruling` value. FR-reference-23 requires the value to name the issue that holds the ruling, and this project names an issue as `#` and a number.
Functions ¶
func CheckKey ¶
CheckKey returns an error when the key does not name the capture, the stream and the method. FR-reference-21 states the three parts, and the port writes them in that order, for example `gre-erspan-vxlan.pcap/0:65174/JA4T.1`.
func CheckReason ¶
CheckReason returns an error when the reason is not one sentence. FR-reference-24 allows one sentence, so the value ends with a full stop and holds no full stop that a space follows.
The check reads a full stop and a space as a sentence break, so it also declines an abbreviation such as `e.g. `. A register reason states one fact about one comparison, and `.claude/rules/ste.md` rule 10 keeps an undefined abbreviation out of it.
func ContainsField ¶
ContainsField reports whether the name is a register field.
Types ¶
type Entry ¶
type Entry struct {
// Key names the capture, the stream and the method.
Key string
// Capability is true for a capability decline and false for a value decline.
Capability bool
// Ours is the value this library produces.
Ours string
// Theirs is the value the reference produces.
Theirs string
// Ruling names the issue that holds the ruling.
Ruling string
// Reason holds one sentence.
Reason string
}
Entry is one accepted difference from a FoxIO value.
func Load ¶
Load returns the parsed register. It returns an error when the file is absent or when it does not parse. The caller runs from the repository root.