@@ -62,8 +62,8 @@ create or replace package body test_expectations_json is
6262 l_actual_message varchar2(32767);
6363 begin
6464 -- Arrange
65- l_expected := json_element_t.parse('{"Aidan Gillen": {"array": ["Game of Thrones","The Wire"],"string": "some string","int": "2","otherint": 4, "aboolean": "true", "boolean": false,"object": {"foo": "bar"}},"Amy Ryan": ["In Treatment","The Wire"],"Annie Fitzgerald": ["True Blood","Big Love","The Sopranos","Oz"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsg?rd": ["Generation Kill","True Blood"],"Alice Farmer": ["The Corner","Oz","The Wire"]}');
66- l_actual := json_element_t.parse('{"Aidan Gillen": {"array": ["Game of Thron\"es","The Wire"],"string": "some string","int": 2,"aboolean": true, "boolean": true,"object": {"foo": "bar","object1": {"new prop1": "new prop value"},"object2": {"new prop1": "new prop value"},"object3": {"new prop1": "new prop value"},"object4": {"new prop1": "new prop value"}}},"Amy Ryan": {"one": "In Treatment","two": "The Wire"},"Annie Fitzgerald": ["Big Love","True Blood"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsgard": ["Generation Kill","True Blood"], "Clarke Peters": null}');
65+ l_actual := json_element_t.parse('{"Aidan Gillen": {"array": ["Game of Thrones","The Wire"],"string": "some string","int": "2","otherint": 4, "aboolean": "true", "boolean": false,"object": {"foo": "bar"}},"Amy Ryan": ["In Treatment","The Wire"],"Annie Fitzgerald": ["True Blood","Big Love","The Sopranos","Oz"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsg?rd": ["Generation Kill","True Blood"],"Alice Farmer": ["The Corner","Oz","The Wire"]}');
66+ l_expected := json_element_t.parse('{"Aidan Gillen": {"array": ["Game of Thron\"es","The Wire"],"string": "some string","int": 2,"aboolean": true, "boolean": true,"object": {"foo": "bar","object1": {"new prop1": "new prop value"},"object2": {"new prop1": "new prop value"},"object3": {"new prop1": "new prop value"},"object4": {"new prop1": "new prop value"}}},"Amy Ryan": {"one": "In Treatment","two": "The Wire"},"Annie Fitzgerald": ["Big Love","True Blood"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsgard": ["Generation Kill","True Blood"], "Clarke Peters": null}');
6767
6868 --Act
6969 ut3_develop.ut.expect( l_actual ).to_equal( l_expected );
@@ -387,7 +387,7 @@ create or replace package body test_expectations_json is
387387 l_actual_message varchar2(32767);
388388 begin
389389 -- Arrange
390- l_expected := json_object_t.parse(' {
390+ l_actual := json_object_t.parse(' {
391391 "Actors": [
392392 {
393393 "name": "Tom Cruise",
@@ -424,7 +424,7 @@ create or replace package body test_expectations_json is
424424 ]
425425 }'
426426 );
427- l_actual := json_object_t.parse(' {
427+ l_expected := json_object_t.parse(' {
428428 "Actors":
429429 {
430430 "name": "Krzystof Jarzyna",
@@ -444,8 +444,8 @@ create or replace package body test_expectations_json is
444444
445445
446446 --Act
447- ut3_develop.ut.expect(json_array_t(json_query(l_actual.stringify,'$.Actors.children'))).to_equal(json_array_t(json_query(l_expected
448- .stringify,'$.Actors[1] .children')));
447+ ut3_develop.ut.expect(json_array_t(json_query(l_actual.stringify,'$.Actors[1] .children'))).to_equal(json_array_t(json_query(l_expected
448+ .stringify,'$.Actors.children')));
449449 --Assert
450450 l_expected_message := q'[%Actual: json was expected to equal: json
451451%Diff: 1 differences found
@@ -1055,7 +1055,7 @@ create or replace package body test_expectations_json is
10551055 l_actual_message varchar2(32767);
10561056 begin
10571057 -- Arrange
1058- l_expected := json_element_t.parse('[
1058+ l_actual := json_element_t.parse('[
10591059 {
10601060 "_id": "5ce6ec46cb9977b050f15d97",
10611061 "index": 0,
@@ -1282,7 +1282,7 @@ create or replace package body test_expectations_json is
12821282 "favoriteFruit": "strawberry"
12831283 }
12841284]');
1285- l_actual := json_element_t.parse('[
1285+ l_expected := json_element_t.parse('[
12861286 {
12871287 "_id": "5ce6ec6660565269b16cf836",
12881288 "index": 0,
@@ -1665,8 +1665,8 @@ create or replace package body test_expectations_json is
16651665 l_actual_message varchar2(32767);
16661666 begin
16671667 -- Arrange
1668- l_expected := json('{"Aidan Gillen": {"array": ["Game of Thrones","The Wire"],"string": "some string","int": "2","otherint": 4, "aboolean": "true", "boolean": false,"object": {"foo": "bar"}},"Amy Ryan": ["In Treatment","The Wire"],"Annie Fitzgerald": ["True Blood","Big Love","The Sopranos","Oz"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsg?rd": ["Generation Kill","True Blood"],"Alice Farmer": ["The Corner","Oz","The Wire"]}');
1669- l_actual := json('{"Aidan Gillen": {"array": ["Game of Thron\"es","The Wire"],"string": "some string","int": 2,"aboolean": true, "boolean": true,"object": {"foo": "bar","object1": {"new prop1": "new prop value"},"object2": {"new prop1": "new prop value"},"object3": {"new prop1": "new prop value"},"object4": {"new prop1": "new prop value"}}},"Amy Ryan": {"one": "In Treatment","two": "The Wire"},"Annie Fitzgerald": ["Big Love","True Blood"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsgard": ["Generation Kill","True Blood"], "Clarke Peters": null}');
1668+ l_actual := json('{"Aidan Gillen": {"array": ["Game of Thrones","The Wire"],"string": "some string","int": "2","otherint": 4, "aboolean": "true", "boolean": false,"object": {"foo": "bar"}},"Amy Ryan": ["In Treatment","The Wire"],"Annie Fitzgerald": ["True Blood","Big Love","The Sopranos","Oz"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsg?rd": ["Generation Kill","True Blood"],"Alice Farmer": ["The Corner","Oz","The Wire"]}');
1669+ l_expected := json('{"Aidan Gillen": {"array": ["Game of Thron\"es","The Wire"],"string": "some string","int": 2,"aboolean": true, "boolean": true,"object": {"foo": "bar","object1": {"new prop1": "new prop value"},"object2": {"new prop1": "new prop value"},"object3": {"new prop1": "new prop value"},"object4": {"new prop1": "new prop value"}}},"Amy Ryan": {"one": "In Treatment","two": "The Wire"},"Annie Fitzgerald": ["Big Love","True Blood"],"Anwan Glover": ["Treme","The Wire"],"Alexander Skarsgard": ["Generation Kill","True Blood"], "Clarke Peters": null}');
16701670
16711671 --Act
16721672 ut3_develop.ut.expect( l_actual ).to_equal( l_expected );
@@ -1784,5 +1784,24 @@ create or replace package body test_expectations_json is
17841784 end;
17851785
17861786 $end
1787+
1788+ procedure p_1113_reg_exp_chg_with_act is
1789+ l_expected_message varchar2(32767);
1790+ l_actual_message varchar2(32767);
1791+ begin
1792+ ut3_develop.ut.expect(json_element_t.parse('{"a":"value a"}')).to_equal(json_element_t.parse('{"a":"value b"}'));
1793+
1794+ --Assert
1795+ l_expected_message := q'[%Actual: json was expected to equal: json
1796+ %Diff: 1 differences found
1797+ %1 unequal values
1798+ %Actual value: "value a" was expected to be: "value b" on path: $."a"%]';
1799+
1800+ l_actual_message := ut3_tester_helper.main_helper.get_failed_expectations(1);
1801+ --Assert
1802+ ut.expect(l_actual_message).to_be_like(l_expected_message);
1803+ end;
1804+
1805+
17871806end;
17881807/
0 commit comments