Title: Actual reported as expected and vice versa for `JSON_ELEMENT_T` · Issue #1113 · utPLSQL/utPLSQL · GitHub
Open Graph Title: Actual reported as expected and vice versa for `JSON_ELEMENT_T` · Issue #1113 · utPLSQL/utPLSQL
X Title: Actual reported as expected and vice versa for `JSON_ELEMENT_T` · Issue #1113 · utPLSQL/utPLSQL
Description: Describe the bug When comparing a JSON_ELEMENT_T value the actual value is reported as expected and the expected value as actual. The following example was taken from http://utplsql.org/utPLSQL/latest/userguide/expectations.html: begin u...
Open Graph Description: Describe the bug When comparing a JSON_ELEMENT_T value the actual value is reported as expected and the expected value as actual. The following example was taken from http://utplsql.org/utPLSQL/lat...
X Description: Describe the bug When comparing a JSON_ELEMENT_T value the actual value is reported as expected and the expected value as actual. The following example was taken from http://utplsql.org/utPLSQL/lat...
Opengraph URL: https://github.com/utPLSQL/utPLSQL/issues/1113
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Actual reported as expected and vice versa for `JSON_ELEMENT_T`","articleBody":"## Describe the bug\r\nWhen comparing a `JSON_ELEMENT_T` value the actual value is reported as expected and the expected value as actual.\r\n\r\nThe following example was taken from http://utplsql.org/utPLSQL/latest/userguide/expectations.html:\r\n\r\n```sql\r\nbegin\r\n ut.expect( 'the tested value' ).to_equal('the expected value');\r\nend;\r\n/\r\n```\r\n\r\nThe first value is the actual value and the second one is the expected value. This should be true regardless of the compared data type.\r\n\r\n## Provide version info\r\n\r\n```\r\n21.0.0.0.0\r\n20.0.0\r\n\r\n\r\nPL/SQL procedure successfully completed.\r\n\r\n\r\nUT_VERSION \r\n------------------------------------------------------------\r\nv3.1.11.3466-develop\r\n\r\n\r\nBANNER BANNER_FULL BANNER_LEGACY CON_ID\r\n-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------\r\nOracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production 0\r\n Version 21.1.0.0.0 \r\n\r\n\r\n\r\nPARAMETER VALUE \r\n------------------------------ ----------------------------------------------------------------\r\nNLS_LANGUAGE AMERICAN \r\nNLS_TERRITORY AMERICA \r\nNLS_CURRENCY $ \r\nNLS_ISO_CURRENCY AMERICA \r\nNLS_NUMERIC_CHARACTERS ., \r\nNLS_CALENDAR GREGORIAN \r\nNLS_DATE_FORMAT DD.MM.YYYY \r\nNLS_DATE_LANGUAGE AMERICAN \r\nNLS_SORT BINARY \r\nNLS_TIME_FORMAT HH.MI.SSXFF AM \r\nNLS_TIMESTAMP_FORMAT DD.MM.YYYY HH24:MI:SSXFF \r\nNLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR \r\nNLS_TIMESTAMP_TZ_FORMAT DD.MM.YYYY HH24:MI:SSXFF TZR \r\nNLS_DUAL_CURRENCY $ \r\nNLS_COMP BINARY \r\nNLS_LENGTH_SEMANTICS BYTE \r\nNLS_NCHAR_CONV_EXCP FALSE \r\n\r\n17 rows selected. \r\n\r\n\r\nPORT_STRING \r\n------------------------------------------------------------\r\nx86_64/Linux 2.4.xx\r\n```\r\n\r\n## Information about client software\r\n\r\nSQL Developer 20.2.0\r\n\r\n## To Reproduce\r\n\r\n### 1. Compare JSON_ELEMENT_T\r\n\r\nRun this code\r\n\r\n```sql\r\nset serveroutput on\r\nbegin\r\n ut.expect(json_element_t.parse('{\"a\":\"value a\"}'))\r\n .to_equal(json_element_t.parse('{\"a\":\"value b\"}'));\r\nend;\r\n/\r\n```\r\n\r\nthe output is\r\n\r\n```\r\nFAILURE\r\n Actual: json was expected to equal: json\r\n Diff: 1 differences found\r\n 1 unequal values\r\n Actual value: \"value b\" was expected to be: \"value a\" on path: $.\"a\"\r\n at \"anonymous block\", line 2\r\n\r\n\r\nPL/SQL procedure successfully completed.\r\n```\r\n\r\n`value a` is reported as expected. That's wrong.\r\n\r\n### 2. Compare VARCHAR2 \r\n\r\nRun this code\r\n\r\n```sql\r\nset serveroutput on\r\nbegin\r\n ut.expect('value a').to_equal('value b');\r\nend;\r\n/\r\n```\r\n\r\nthe output is\r\n\r\n```\r\nFAILURE\r\n Actual: 'value a' (varchar2) was expected to equal: 'value b' (varchar2)\r\n at \"anonymous block\", line 2\r\n\r\n\r\nPL/SQL procedure successfully completed.\r\n```\r\n\r\n`value b` is reported as expected. That's correct. \r\n\r\n## Expected behavior\r\n\r\nWhen comparing a `JSON_ELEMENT_T` report expected and actual values as for other data types (e.g. `NUMBER` or `VARCHAR2`).\r\n","author":{"url":"https://github.com/PhilippSalvisberg","@type":"Person","name":"PhilippSalvisberg"},"datePublished":"2020-12-13T12:25:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1113/utPLSQL/issues/1113"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1d74e4d2-4565-3f0c-e61e-cd66ed9a2609 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B946:93E78:84582E:88552D:6A638346 |
| html-safe-nonce | 6a1764d5149b435a0cd37015f6f0815317655ada420f0701c80002eab73ab3cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTQ2OjkzRTc4Ojg0NTgyRTo4ODU1MkQ6NkE2MzgzNDYiLCJ2aXNpdG9yX2lkIjoiNzI1ODY5OTgzMzg5MzE1OTc1MCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 43db4a22d02ed127012adb97c5b1d74c3f4ff0f5ca45278a4862e07bb6ad6c7c |
| hovercard-subject-tag | issue:765344472 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/utPLSQL/utPLSQL/1113/issue_layout |
| twitter:image | https://opengraph.githubassets.com/da38fe4255e5a95eb49a2509e9b9f6a540aacb53df1f0a58c861099c860d17ff/utPLSQL/utPLSQL/issues/1113 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/da38fe4255e5a95eb49a2509e9b9f6a540aacb53df1f0a58c861099c860d17ff/utPLSQL/utPLSQL/issues/1113 |
| og:image:alt | Describe the bug When comparing a JSON_ELEMENT_T value the actual value is reported as expected and the expected value as actual. The following example was taken from http://utplsql.org/utPLSQL/lat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PhilippSalvisberg |
| hostname | github.com |
| expected-hostname | github.com |
| None | e4fb64aef87da454ec25b158147f7f5f14aef29216e5ca1612c2e48faa599d1f |
| turbo-cache-control | no-preview |
| go-import | github.com/utPLSQL/utPLSQL git https://github.com/utPLSQL/utPLSQL.git |
| octolytics-dimension-user_id | 15661281 |
| octolytics-dimension-user_login | utPLSQL |
| octolytics-dimension-repository_id | 50728220 |
| octolytics-dimension-repository_nwo | utPLSQL/utPLSQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 50728220 |
| octolytics-dimension-repository_network_root_nwo | utPLSQL/utPLSQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e839936ba5faffb9c836dda1cf4729d50c88a32e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width