Z User
phase7: MCP stdio smoke test (handshake + tools/list + get_roots 6:74) — 4/4 tests PASS
54a6341 Download node_modules/fast-uri/test/urn-full-input.test.js from bravesigma/quran-md-plugin: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/fast-uri/test/urn-full-input.test.js
- Command line
-
hf download hf://datasets/bravesigma/quran-md-plugin/node_modules/fast-uri/test/urn-full-input.test.js
-
curl -L -o urn-full-input.test.js https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/fast-uri/test/urn-full-input.test.js
1.32 kB
| const test = require('tape') | |
| const fastURI = require('..') | |
| test('URN parsing validates the complete scheme-specific input', (t) => { | |
| const embedded = fastURI.parse('urn:x|foo:bar') | |
| t.equal(embedded.error, 'URN can not be parsed.', 'does not search for a later nid:nss substring') | |
| t.equal(embedded.nid, undefined, 'does not adopt the later nid') | |
| t.equal(embedded.nss, undefined, 'does not adopt the later nss') | |
| const trailing = fastURI.parse('urn:foo:bar|ignored') | |
| t.equal(trailing.error, 'URN can not be parsed.', 'rejects trailing input outside the RFC 2141 NSS grammar') | |
| t.equal(trailing.nid, undefined, 'does not return an nid from a partial match') | |
| t.equal(trailing.nss, undefined, 'does not return a truncated nss') | |
| t.end() | |
| }) | |
| test('URN parsing preserves the complete RFC 2141 NSS', (t) => { | |
| const parsed = fastURI.parse('urn:foo:allowed/evil') | |
| t.equal(parsed.error, undefined, 'accepts slash in an RFC 2141 NSS') | |
| t.equal(parsed.nid, 'foo', 'parses the nid') | |
| t.equal(parsed.nss, 'allowed/evil', 'preserves the complete NSS') | |
| t.equal(fastURI.normalize('urn:foo:allowed/evil'), 'urn:foo:allowed/evil', 'normalization retains slash data') | |
| t.equal(fastURI.equal('urn:foo:allowed/evil', 'urn:foo:allowed'), false, 'distinct NSS values do not compare equal') | |
| t.end() | |
| }) | |