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 a case last changed
expiresDateOnly when the data behind it runs out, like a magnetic model's last day
licenceOnly when the file isn't CC0: its licence, and the credit it asks for
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, and how near a border a list of labels may differ
casesThe tests: each with an id, an operation, tags, an optional note saying why it exists, 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. publishedDate moves when a case’s input or expected values change; a new note doesn’t move it.

The file is written to be read: indented two spaces, with its properties in the order above and each case’s as id, operation, tags, note, input, expected. A named case has a note; its algorithm’s page lists those as its edge cases. Cases at random points don’t.

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, in decimal digits only. Years −9999 to 9999; a year of more digits is outOfRange.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 listNamed for what it holds, plural. An input's list holds objects whose fields follow these rules. An output's list holds labels, like zone names, in any order; every other output is a single value.constituents, timeZoneNames
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 up to 360. An answer that would round to 360 is 0.rightAscensionInHours
A number that isn't finiteJSON can't write one, so an input in a refusal case may be the string "NaN", "Infinity" or "-Infinity""bearingInDegrees": "NaN"
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.

An input whose field says it’s optional may be left out of a case, and then takes the value the field gives, like a star’s proper motion of 0. An input never says null.

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.

Bad input is always refused, never answered: NaN or infinity anywhere, an instant outside its years, a value outside its field’s range. An implementation never crashes on it and never makes up an answer. Some bad input can’t be written in a file, like a date the language itself marks invalid; the implementation refuses it all the same, as outOfRange.

Implementations

An implementation is a repo that follows one contract, so it can be checked the same way in any language. The code isn’t public yet; algorithms-swift is the worked example.

Each implementation’s CI grades it with this site’s checker, which feeds every published file to mise run evaluate and judges each answer. Placeholder files are skipped. It runs on every push to the implementation’s main, and again whenever the test data or the checker changes, and commits the results here. The home page shows each one’s latest results, with the commit graded and the compiler that built it.

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 next check.