diff --git a/Makefile b/Makefile index f8731ede..b67fb875 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ .DEFAULT_GOAL := all JSONSCHEMA ?= ./node_modules/@sourcemeta/jsonschema/npm/cli.js +JQ ?= jq SHELLCHECK ?= shellcheck +MKDIRP ?= mkdir -p NODE ?= node NPM ?= npm TIME ?= time diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/arcminute.json b/schemas/2020-12/bipm/si/2019/non-si/unit/arcminute.json new file mode 100644 index 00000000..4244a475 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/arcminute.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Arcminute", + "description": "A non-SI unit of plane angle accepted for use with the SI. One arcminute is equal to (1/60) degree or (pi/10800) radians", + "examples": [ 0, 1, 30, 60, -30, 15.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "(pi/10800) rad", + "x-symbol": "′", + "type": "number" +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/arcsecond.json b/schemas/2020-12/bipm/si/2019/non-si/unit/arcsecond.json new file mode 100644 index 00000000..bd46244d --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/arcsecond.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Arcsecond", + "description": "A non-SI unit of plane angle accepted for use with the SI. One arcsecond is equal to (1/60) arcminute or (pi/648000) radians", + "examples": [ 0, 1, 30, 60, -30, 15.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "(pi/648000) rad", + "x-symbol": "″", + "type": "number" +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/astronomical-unit.json b/schemas/2020-12/bipm/si/2019/non-si/unit/astronomical-unit.json new file mode 100644 index 00000000..0e1246c9 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/astronomical-unit.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Astronomical Unit", + "description": "A non-SI unit of length accepted for use with the SI. One astronomical unit is a conventional unit of length approximately equal to the mean Earth-Sun distance. It is defined as exactly 149597870700 metres", + "examples": [ 0, 1, 0.387, 1.524, 5.203, 39.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "149597870700 m", + "x-symbol": "au", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/dalton.json b/schemas/2020-12/bipm/si/2019/non-si/unit/dalton.json new file mode 100644 index 00000000..d1731f10 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/dalton.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dalton", + "description": "A non-SI unit of mass accepted for use with the SI. One dalton is equal to (1/12) of the mass of an unbound neutral carbon-12 atom in its nuclear and electronic ground state. It is approximately 1.660 539 066 60 x 10^-27 kg", + "examples": [ 1, 12, 16, 18, 28, 44, 180.16 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "1.660539066605e-27 kg", + "x-symbol": "Da", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/day.json b/schemas/2020-12/bipm/si/2019/non-si/unit/day.json new file mode 100644 index 00000000..3d68cc2b --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/day.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Day", + "description": "A non-SI unit of time accepted for use with the SI. One day is equal to 24 hours or 86400 seconds", + "examples": [ 0, 1, 7, 30, 365, 0.5, 1.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "86400 s", + "x-symbol": "d", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/degree.json b/schemas/2020-12/bipm/si/2019/non-si/unit/degree.json new file mode 100644 index 00000000..893ef5a9 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/degree.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Degree", + "description": "A non-SI unit of plane angle accepted for use with the SI. One degree is equal to (pi/180) radians", + "examples": [ 0, 45, 90, 180, 360, -90, -180, 37.7749 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "(pi/180) rad", + "x-symbol": "°", + "type": "number" +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/electronvolt.json b/schemas/2020-12/bipm/si/2019/non-si/unit/electronvolt.json new file mode 100644 index 00000000..a3b3c2a1 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/electronvolt.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Electronvolt", + "description": "A non-SI unit of energy accepted for use with the SI. One electronvolt is the kinetic energy acquired by an electron in passing through a potential difference of one volt in vacuum. It is equal to approximately 1.602 176 634 x 10^-19 joules", + "examples": [ 0, 1, 13.6, 511000, 1000000, 1e+9 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "1.602176634e-19 J", + "x-symbol": "eV", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/hectare.json b/schemas/2020-12/bipm/si/2019/non-si/unit/hectare.json new file mode 100644 index 00000000..9c8ca67c --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/hectare.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Hectare", + "description": "A non-SI unit of area accepted for use with the SI. One hectare is equal to 10000 square metres", + "examples": [ 0, 1, 10, 100, 0.5, 2.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "10000 m^2", + "x-symbol": "ha", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/hour.json b/schemas/2020-12/bipm/si/2019/non-si/unit/hour.json new file mode 100644 index 00000000..9175c68e --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/hour.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Hour", + "description": "A non-SI unit of time accepted for use with the SI. One hour is equal to 60 minutes or 3600 seconds", + "examples": [ 0, 1, 6, 12, 24, 1.5, 0.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "3600 s", + "x-symbol": "h", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/litre.json b/schemas/2020-12/bipm/si/2019/non-si/unit/litre.json new file mode 100644 index 00000000..ac5fd392 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/litre.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Litre", + "description": "A non-SI unit of volume accepted for use with the SI. One litre is equal to one cubic decimetre (0.001 cubic metres)", + "examples": [ 0, 1, 0.5, 2, 1.5, 100, 0.25 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "0.001 m^3", + "x-symbol": "l", + "x-symbol-alt": "L", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/minute.json b/schemas/2020-12/bipm/si/2019/non-si/unit/minute.json new file mode 100644 index 00000000..260ee9d5 --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/minute.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Minute", + "description": "A non-SI unit of time accepted for use with the SI. One minute is equal to 60 seconds", + "examples": [ 0, 1, 5, 30, 60, 90, 1.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "60 s", + "x-symbol": "min", + "type": "number", + "minimum": 0 +} diff --git a/schemas/2020-12/bipm/si/2019/non-si/unit/tonne.json b/schemas/2020-12/bipm/si/2019/non-si/unit/tonne.json new file mode 100644 index 00000000..45b79ebd --- /dev/null +++ b/schemas/2020-12/bipm/si/2019/non-si/unit/tonne.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Tonne", + "description": "A non-SI unit of mass accepted for use with the SI. One tonne is equal to 1000 kilograms", + "examples": [ 0, 1, 10, 100, 0.5, 2.5 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.bipm.org/en/publications/si-brochure" ], + "x-si-equivalent": "1000 kg", + "x-symbol": "t", + "type": "number", + "minimum": 0 +} diff --git a/test/bipm/si/2019/non-si/unit/arcminute.test.json b/test/bipm/si/2019/non-si/unit/arcminute.test.json new file mode 100644 index 00000000..72e7fbb2 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/arcminute.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/arcminute.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one arcminute", + "data": 1, + "valid": true + }, + { + "description": "Valid - one degree in arcminutes", + "data": 60, + "valid": true + }, + { + "description": "Valid - negative", + "data": -30, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 15.5, + "valid": true + }, + { + "description": "Invalid type - string", + "data": "30", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/arcsecond.test.json b/test/bipm/si/2019/non-si/unit/arcsecond.test.json new file mode 100644 index 00000000..a5eea41d --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/arcsecond.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/arcsecond.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one arcsecond", + "data": 1, + "valid": true + }, + { + "description": "Valid - one arcminute in arcseconds", + "data": 60, + "valid": true + }, + { + "description": "Valid - negative", + "data": -30, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 15.5, + "valid": true + }, + { + "description": "Invalid type - string", + "data": "30", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/astronomical-unit.test.json b/test/bipm/si/2019/non-si/unit/astronomical-unit.test.json new file mode 100644 index 00000000..855f1d80 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/astronomical-unit.test.json @@ -0,0 +1,61 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/astronomical-unit.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - Earth-Sun distance", + "data": 1, + "valid": true + }, + { + "description": "Valid - Mercury distance", + "data": 0.387, + "valid": true + }, + { + "description": "Valid - Mars distance", + "data": 1.524, + "valid": true + }, + { + "description": "Valid - Pluto distance", + "data": 39.5, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "1", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/dalton.test.json b/test/bipm/si/2019/non-si/unit/dalton.test.json new file mode 100644 index 00000000..be0b4689 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/dalton.test.json @@ -0,0 +1,61 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/dalton.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - hydrogen atomic mass", + "data": 1, + "valid": true + }, + { + "description": "Valid - carbon atomic mass", + "data": 12, + "valid": true + }, + { + "description": "Valid - water molecular mass", + "data": 18, + "valid": true + }, + { + "description": "Valid - glucose molecular mass", + "data": 180.16, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "12", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/day.test.json b/test/bipm/si/2019/non-si/unit/day.test.json new file mode 100644 index 00000000..75201710 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/day.test.json @@ -0,0 +1,61 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/day.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one day", + "data": 1, + "valid": true + }, + { + "description": "Valid - one week in days", + "data": 7, + "valid": true + }, + { + "description": "Valid - one year in days", + "data": 365, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 0.5, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "7", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/degree.test.json b/test/bipm/si/2019/non-si/unit/degree.test.json new file mode 100644 index 00000000..3781796d --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/degree.test.json @@ -0,0 +1,61 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/degree.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - right angle", + "data": 90, + "valid": true + }, + { + "description": "Valid - straight angle", + "data": 180, + "valid": true + }, + { + "description": "Valid - full rotation", + "data": 360, + "valid": true + }, + { + "description": "Valid - negative angle", + "data": -90, + "valid": true + }, + { + "description": "Valid - decimal degrees", + "data": 37.7749, + "valid": true + }, + { + "description": "Invalid type - string", + "data": "90", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/electronvolt.test.json b/test/bipm/si/2019/non-si/unit/electronvolt.test.json new file mode 100644 index 00000000..8ed63548 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/electronvolt.test.json @@ -0,0 +1,61 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/electronvolt.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one electronvolt", + "data": 1, + "valid": true + }, + { + "description": "Valid - hydrogen ionization energy", + "data": 13.6, + "valid": true + }, + { + "description": "Valid - electron rest mass energy", + "data": 511000, + "valid": true + }, + { + "description": "Valid - GeV scale", + "data": 1e+9, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "1", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/hectare.test.json b/test/bipm/si/2019/non-si/unit/hectare.test.json new file mode 100644 index 00000000..b784ed67 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/hectare.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/hectare.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one hectare", + "data": 1, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 0.5, + "valid": true + }, + { + "description": "Valid - large area", + "data": 1000, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "1", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/hour.test.json b/test/bipm/si/2019/non-si/unit/hour.test.json new file mode 100644 index 00000000..38890dd9 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/hour.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/hour.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one hour", + "data": 1, + "valid": true + }, + { + "description": "Valid - one day in hours", + "data": 24, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 1.5, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -5, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "24", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/litre.test.json b/test/bipm/si/2019/non-si/unit/litre.test.json new file mode 100644 index 00000000..93b4e4d8 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/litre.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/litre.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one litre", + "data": 1, + "valid": true + }, + { + "description": "Valid - half litre", + "data": 0.5, + "valid": true + }, + { + "description": "Valid - large volume", + "data": 1000, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "1", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/minute.test.json b/test/bipm/si/2019/non-si/unit/minute.test.json new file mode 100644 index 00000000..932dff25 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/minute.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/minute.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one minute", + "data": 1, + "valid": true + }, + { + "description": "Valid - one hour in minutes", + "data": 60, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 1.5, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -5, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "60", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/bipm/si/2019/non-si/unit/tonne.test.json b/test/bipm/si/2019/non-si/unit/tonne.test.json new file mode 100644 index 00000000..0d3c5fa3 --- /dev/null +++ b/test/bipm/si/2019/non-si/unit/tonne.test.json @@ -0,0 +1,56 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/tonne.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - one tonne", + "data": 1, + "valid": true + }, + { + "description": "Valid - fractional", + "data": 0.5, + "valid": true + }, + { + "description": "Valid - large mass", + "data": 1000, + "valid": true + }, + { + "description": "Invalid - negative", + "data": -1, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "1", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +}