[
{ "name": "a 6-digit HS subheading", "args": ["847130"], "expect": { "valid": true, "normalised": "847130", "kind": "hs", "chapter": "84", "heading": "8471", "subheading": "847130", "reason": null } },
{ "name": "an 8-digit CN code written with dots", "args": ["8471.30.00"], "expect": { "valid": true, "normalised": "84713000", "kind": "cn", "chapter": "84", "heading": "8471", "subheading": "847130", "reason": null } },
{ "name": "a 10-digit code keeps the leading zero of chapter 01", "args": ["0101 21 00 00"], "expect": { "valid": true, "normalised": "0101210000", "kind": "taric", "chapter": "01", "heading": "0101", "subheading": "010121", "reason": null } },
{ "name": "an undivided heading ends in 00 and is fine", "args": ["0409.00"], "expect": { "valid": true, "normalised": "040900", "kind": "hs", "chapter": "04", "heading": "0409", "subheading": "040900", "reason": null } },
{ "name": "chapter 97 is the last HS chapter", "args": ["970191"], "expect": { "valid": true, "normalised": "970191", "kind": "hs", "chapter": "97", "heading": "9701", "subheading": "970191", "reason": null } },
{ "name": "chapter 99 is valid in an 8-digit national code", "args": ["99050000"], "expect": { "valid": true, "normalised": "99050000", "kind": "cn", "chapter": "99", "heading": "9905", "subheading": "990500", "reason": null } },
{ "name": "chapter 98 is not part of the HS at 6 digits", "args": ["980100"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "national-chapter" } },
{ "name": "chapter 77 is reserved", "args": ["7701000000"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "reserved-chapter" } },
{ "name": "chapter 00 does not exist", "args": ["000000"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "bad-chapter" } },
{ "name": "heading 00 does not exist", "args": ["840012"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "bad-heading" } },
{ "name": "a 4-digit heading is not a commodity code", "args": ["8471"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "bad-length" } },
{ "name": "nine digits", "args": ["847130000"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "bad-length" } },
{ "name": "a hyphen is not a separator", "args": ["8471-30"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "bad-character" } },
{ "name": "full-width digits are not ASCII digits", "args": ["847130"], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "bad-character" } },
{ "name": "only separators", "args": [" . . "], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "empty" } },
{ "name": "empty", "args": [""], "expect": { "valid": false, "normalised": null, "kind": null, "chapter": null, "heading": null, "subheading": null, "reason": "empty" } }
]