bbc / draft-humfrey-radio-scheme

IETF Draft for URI Schemes for Terrestrial Radio Services
Other
2 stars 0 forks source link

Wrote ABNF test suite using node.js and heket #8

Closed njh closed 4 years ago

njh commented 4 years ago

Result of running tests:

> mocha -u tdd && standard

  AMSS URI Scheme
    ✓ Valid AMSS URI
    ✓ Invalid SId - too short

  DAB URI Scheme
    ✓ Valid DAB URI
    ✓ Valid DAB URI with long SID and UAType
    ✓ Invalid GCC - not hex
    ✓ Invalid SId - too short
    ✓ Invalid SId - 6 characters

  DRM URI Scheme
    ✓ Valid DRM URI
    ✓ Valid DRM URI with App Domain and UAType
    ✓ Invalid SId - too short
    ✓ Invalid App Domain - too long
    ✓ Invalid UAType - too long
    ✓ Invalid App Domain - UAType missing

  FM URI Scheme
    ✓ Valid fm URI scheme with GCC, PI Code and frequency
    ✓ Valid fm URI scheme with wildcard frequency
    ✓ Invalid GCC - not hex
    ✓ Invalid PI Code - too short

  Invalid URI Scheme
    ✓ foo scheme

  18 passing (60ms)
ghost commented 4 years ago

Instead of pulling this from a separate file, why doesn't the test pull it from the draft itself? We just have to scan the file and extract everything between the ~~~abnf and the next ~~~ blocks.

njh commented 4 years ago

@tigertoes yup, good idea. I was going to ask you what the best approach was to that.

If this PR otherwise looks good, can we merge this PR and then make an improvement to extract it from the main text?