Test data format

Every algorithm’s test data is one JSON file in the same shape, with fields named by the same rules. Read this once and every file reads the same way. algorithms.json lists every file.

The file

PropertyHolds
algorithmThe algorithm's slug, as in its page's address: wmm
placeholderOnly while the values are made up, saying so. Never test against a file that has it.
publishedDateWhen this file was last changed
expiresDateOnly when the data behind it runs out, like a magnetic model's last day
earthModelThe earth the numbers are on: WGS84, or a sphere and its radius
sourcesWhere the values come from: each with role, name, by, url and licence
operationsWhat can be computed: each with an id, what it gives, and the names of its inputs and outputs
fieldsEvery input and output name, with what it means and its range
tolerancesHow close each numeric output must be
casesThe tests: each with an id, an operation, tags, an input and what's expected

The file has no version. It changes in place, and an implementation is always checked against the current file.

Naming

A field’s name says what it is and, for a number, its unit. The same name means the same thing in every file.

KindRuleLike
Every namelowerCamelCase English words. No abbreviations but established ones.eastingInMeters
A number with a unitEnds in In and the unit, spelled outdistanceInMeters, deltaTInSeconds, precisionInDigits
A number without a unitNamed for what it isjulianDay, decimalYear, illuminationFraction, pointScale
An instantEnds in Utc. ISO 8601 in UTC with a Z, to the second.riseUtc "2026-06-21T12:04:00Z"
A calendar dateIs or ends in date. YYYY-MM-DD.publishedDate, date
Text for a personEnds in TextbearingText "000°"
A choiceA lowerCamelCase word from the list in the field's meaninghemisphere "north", phaseName "waxingCrescent"
Yes or noStarts with is or hasisAlwaysUp
A pair of places or bearingsStarts with from and tofromLatitudeInDegrees
AnglesDegrees, except where a field says hours. East and north positive; bearings clockwise from north, 0 to 360.rightAscensionInHours
OperationslowerCamelCase, a verb or the thing giventoMgrs, events
Case idskebab-case, starting with where the case came fromnoaa-3, edge-svalbard-33x

null means the thing doesn’t exist, like a sunrise on a day without one. It never means unknown.

Comparing

Cases

Each case’s tags say where its values came from and what it tests.

TagMeans
publishedThe authority's own published value
referenceOutput of the reference program, kept with the file
handWorked out from a definition, like a compass point's name
edgeA named edge case
polarNear a pole
invalidInput that must be refused

A case expecting refusal has "expected": { "error": "outOfRange" }. The errors are outOfRange, for input outside a field’s range, and invalidInput, for input that can’t be read.

Implementations

An implementation is a public repo that follows one contract, so it can be checked the same way in any language. algorithms-template is a GitHub template with the contract already wired up; algorithms-swift is a worked example.

An algorithm with every case passing passes. One with a failing case fails. One with any notImplemented case is incomplete. A result against an older publishedDate counts as incomplete until the check runs again.

algorithms-check -h lists its options: -only wmm checks one algorithm, and -source takes a directory of test files for working offline.