Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add uri-js tests #86

Merged
merged 4 commits into from
Jun 15, 2024
Merged

add uri-js tests #86

merged 4 commits into from
Jun 15, 2024

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Jun 13, 2024

Current status:

ℹ tests 32
ℹ suites 0
ℹ pass 21
ℹ fail 11
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 29.631727

output:

aras@aras-Lenovo-Legion-5-17ARH05H:~/workspace/fast-uri$ node ./test/uri-js.test.js 
✔ Acquire URI (1.134565ms)
✔ URI Parsing (1.286119ms)
✔ URI Serialization (0.742828ms)
✖ URI Resolving (1.487959ms)
  AssertionError [ERR_ASSERTION]: /adf\ngf
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:417:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: '//www.g.com/adf\ngf',
    expected: '//www.g.com/adf%0Agf',
    operator: 'strictEqual'
  }

✖ URI Normalizing (0.892636ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/red%252509ros%25C3%25A9#red'
  - 'uri://www.example.org/red%09ros%C3%A9#red'
                               ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:423:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/red%252509ros%25C3%25A9#red',
    expected: 'uri://www.example.org/red%09ros%C3%A9#red',
    operator: 'strictEqual'
  }

✔ URI Equals (0.388595ms)
✖ Escape Component (0.174602ms)
  TypeError: URI.escapeComponent is not a function
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:459:23)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7)

✖ Unescape Component (0.123409ms)
  TypeError: URI.unescapeComponent is not a function
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:474:21)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7)

✖ IRI Parsing (1.314545ms)
  AssertionError [ERR_ASSERTION]: path
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:496:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: '/o%EF%A4%80ne/t%EF%B7%8Fwo.t%EF%B7%B0hree',
    expected: '/o豈ne/t﷏wo.tﷰhree',
    operator: 'strictEqual'
  }

✖ IRI Serialization (0.589806ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://us er:pa퟿[email protected]:123/o%uF900ne/t%uFDCFwo.t%uFDF0hree?q1=a1&q2=a2#bo￯dy'
  - 'uri://us er:pa퟿[email protected]:123/o豈ne/t﷏wo.tﷰhree?q1=a1&q2=a2#bo￯dy%EE%80%81'
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:511:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://us er:pa퟿[email protected]:123/o%uF900ne/t%uFDCFwo.t%uFDF0hree?q1=a1&q2=a2#bo￯dy',
    expected: 'uri://us er:pa퟿[email protected]:123/o豈ne/t﷏wo.tﷰhree?q1=a1&q2=a2#bo￯dy%EE%80%81',
    operator: 'strictEqual'
  }

✖ IRI Normalizing (0.248145ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/red%252509ros%25C3%25A9#red'
  - 'uri://www.example.org/red%09rosé#red'
                               ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:515:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/red%252509ros%25C3%25A9#red',
    expected: 'uri://www.example.org/red%09rosé#red',
    operator: 'strictEqual'
  }

✖ IRI Equals (0.177885ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  false !== true
  
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:520:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: 'strictEqual'
  }

✖ Convert IRI to URI (0.212456ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/red%252509ros%25C3%25A9#red'
  - 'uri://www.example.org/red%09ros%C3%A9#red'
                               ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:525:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/red%252509ros%25C3%25A9#red',
    expected: 'uri://www.example.org/red%09ros%C3%A9#red',
    operator: 'strictEqual'
  }

✖ Convert URI to IRI (0.297243ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/D%2525C3%2525BCrst'
  - 'uri://www.example.org/Dürst'
                            ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:533:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/D%2525C3%2525BCrst',
    expected: 'uri://www.example.org/Dürst',
    operator: 'strictEqual'
  }

✔ HTTP Equals (0.181935ms)
✔ HTTPS Equals (0.143523ms)
✔ URN Parsing (0.269656ms)
✔ URN Serialization (0.137866ms)
✖ URN Equals (0.474708ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  true !== false
  
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:606:5)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: true,
    expected: false,
    operator: 'strictEqual'
  }

✔ URN Resolving (0.142406ms)
✔ UUID Parsing (0.389992ms)
✔ UUID Serialization (0.137377ms)
✔ UUID Equals (0.102526ms)
✔ URN NID Override (0.112792ms)
✔ WS Parse (0.155955ms)
✔ WS Serialize (0.295636ms)
✔ WS Equal (0.120057ms)
✔ WS Normalize (0.07906ms)
✔ WSS Parse (0.158888ms)
✔ WSS Serialize (0.137447ms)
✔ WSS Equal (0.085764ms)
✔ WSS Normalize (0.070539ms)
ℹ tests 32
ℹ suites 0
ℹ pass 21
ℹ fail 11
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 29.631727

✖ failing tests:

test at test/uri-js.test.js:362:1
✖ URI Resolving (1.487959ms)
  AssertionError [ERR_ASSERTION]: /adf\ngf
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:417:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: '//www.g.com/adf\ngf',
    expected: '//www.g.com/adf%0Agf',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:421:1
✖ URI Normalizing (0.892636ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/red%252509ros%25C3%25A9#red'
  - 'uri://www.example.org/red%09ros%C3%A9#red'
                               ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:423:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/red%252509ros%25C3%25A9#red',
    expected: 'uri://www.example.org/red%09ros%C3%A9#red',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:454:1
✖ Escape Component (0.174602ms)
  TypeError: URI.escapeComponent is not a function
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:459:23)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7)

test at test/uri-js.test.js:470:1
✖ Unescape Component (0.123409ms)
  TypeError: URI.unescapeComponent is not a function
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:474:21)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7)

test at test/uri-js.test.js:488:1
✖ IRI Parsing (1.314545ms)
  AssertionError [ERR_ASSERTION]: path
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:496:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: '/o%EF%A4%80ne/t%EF%B7%8Fwo.t%EF%B7%B0hree',
    expected: '/o豈ne/t﷏wo.tﷰhree',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:501:1
✖ IRI Serialization (0.589806ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://us er:pa퟿[email protected]:123/o%uF900ne/t%uFDCFwo.t%uFDF0hree?q1=a1&q2=a2#bo￯dy'
  - 'uri://us er:pa퟿[email protected]:123/o豈ne/t﷏wo.tﷰhree?q1=a1&q2=a2#bo￯dy%EE%80%81'
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:511:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://us er:pa퟿[email protected]:123/o%uF900ne/t%uFDCFwo.t%uFDF0hree?q1=a1&q2=a2#bo￯dy',
    expected: 'uri://us er:pa퟿[email protected]:123/o豈ne/t﷏wo.tﷰhree?q1=a1&q2=a2#bo￯dy%EE%80%81',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:514:1
✖ IRI Normalizing (0.248145ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/red%252509ros%25C3%25A9#red'
  - 'uri://www.example.org/red%09rosé#red'
                               ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:515:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/red%252509ros%25C3%25A9#red',
    expected: 'uri://www.example.org/red%09rosé#red',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:518:1
✖ IRI Equals (0.177885ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  false !== true
  
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:520:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:523:1
✖ Convert IRI to URI (0.212456ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/red%252509ros%25C3%25A9#red'
  - 'uri://www.example.org/red%09ros%C3%A9#red'
                               ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:525:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/red%252509ros%25C3%25A9#red',
    expected: 'uri://www.example.org/red%09ros%C3%A9#red',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:531:1
✖ Convert URI to IRI (0.297243ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  + actual - expected
  
  + 'uri://www.example.org/D%2525C3%2525BCrst'
  - 'uri://www.example.org/Dürst'
                            ^
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:533:3)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 'uri://www.example.org/D%2525C3%2525BCrst',
    expected: 'uri://www.example.org/Dürst',
    operator: 'strictEqual'
  }

test at test/uri-js.test.js:601:3
✖ URN Equals (0.474708ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  
  true !== false
  
      at TestContext.<anonymous> (/home/aras/workspace/fast-uri/test/uri-js.test.js:606:5)
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:749:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:463:18)
      at Test.postRun (node:internal/test_runner/test:848:19)
      at Test.run (node:internal/test_runner/test:791:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:463:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: true,
    expected: false,
    operator: 'strictEqual'
  }

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Could you skip the one that are failing so we can land them?

Or fix them all.

test/uri-js.test.js Show resolved Hide resolved
@gurgunday
Copy link
Member

I will start working on them right after the merge

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Jun 14, 2024

@mcollina
@gurgunday

skipping failing tests

Also see for detected issues #90 and #89

@mcollina
Copy link
Member

CI is failing on Node.js v14

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Jun 14, 2024

@mcollina

rewrote the test harness to use tap

@gurgunday gurgunday merged commit 9bb2904 into main Jun 15, 2024
28 checks passed
@gurgunday gurgunday deleted the integrate-uri-js-tests branch June 15, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants