GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Actual reported as expected and vice versa for `JSON_ELEMENT_T` · Issue #1113 · utPLSQL/utPLSQL

Actual reported as expected and vice versa for JSON_ELEMENT_T #1113

New issue
Copy link
New issue
Copy link
Closed
#1181
Closed
Actual reported as expected and vice versa for JSON_ELEMENT_T#1113
#1181
Copy link
Assignees
lwasylow
Labels
bug

Description

@PhilippSalvisberg
PhilippSalvisberg
opened on Dec 13, 2020
Issue body actions

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
  ut.expect( 'the tested value' ).to_equal('the expected value');
end;
/

The first value is the actual value and the second one is the expected value. This should be true regardless of the compared data type.

Provide version info

21.0.0.0.0
20.0.0


PL/SQL procedure successfully completed.


UT_VERSION                                                  
------------------------------------------------------------
v3.1.11.3466-develop


BANNER                                                                           BANNER_FULL                                                                                                                                                      BANNER_LEGACY                                                                        CON_ID
-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
Oracle 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
                                                                                 Version 21.1.0.0.0                                                                                                                                                                                                                                          



PARAMETER                      VALUE                                                           
------------------------------ ----------------------------------------------------------------
NLS_LANGUAGE                   AMERICAN                                                        
NLS_TERRITORY                  AMERICA                                                         
NLS_CURRENCY                   $                                                               
NLS_ISO_CURRENCY               AMERICA                                                         
NLS_NUMERIC_CHARACTERS         .,                                                              
NLS_CALENDAR                   GREGORIAN                                                       
NLS_DATE_FORMAT                DD.MM.YYYY                                                      
NLS_DATE_LANGUAGE              AMERICAN                                                        
NLS_SORT                       BINARY                                                          
NLS_TIME_FORMAT                HH.MI.SSXFF AM                                                  
NLS_TIMESTAMP_FORMAT           DD.MM.YYYY HH24:MI:SSXFF                                        
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR                                              
NLS_TIMESTAMP_TZ_FORMAT        DD.MM.YYYY HH24:MI:SSXFF TZR                                    
NLS_DUAL_CURRENCY              $                                                               
NLS_COMP                       BINARY                                                          
NLS_LENGTH_SEMANTICS           BYTE                                                            
NLS_NCHAR_CONV_EXCP            FALSE                                                           

17 rows selected. 


PORT_STRING                                                 
------------------------------------------------------------
x86_64/Linux 2.4.xx

Information about client software

SQL Developer 20.2.0

To Reproduce

1. Compare JSON_ELEMENT_T

Run this code

set serveroutput on
begin
   ut.expect(json_element_t.parse('{"a":"value a"}'))
      .to_equal(json_element_t.parse('{"a":"value b"}'));
end;
/

the output is

FAILURE
  Actual: json was expected to equal: json
  Diff: 1 differences found
  1 unequal values
    Actual value: "value b" was expected to be: "value a" on path: $."a"
  at "anonymous block", line 2


PL/SQL procedure successfully completed.

value a is reported as expected. That's wrong.

2. Compare VARCHAR2

Run this code

set serveroutput on
begin
   ut.expect('value a').to_equal('value b');
end;
/

the output is

FAILURE
  Actual: 'value a' (varchar2) was expected to equal: 'value b' (varchar2)
  at "anonymous block", line 2


PL/SQL procedure successfully completed.

value b is reported as expected. That's correct.

Expected behavior

When comparing a JSON_ELEMENT_T report expected and actual values as for other data types (e.g. NUMBER or VARCHAR2).

Activity

  1. PhilippSalvisberg
    added
    bug
    on Dec 13, 2020
  2. lwasylow
    self-assigned this
    on Feb 1, 2022
  3. lwasylow
    closed this as completedin #1181on Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lwasylow
    lwasylow

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.