Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a77a7f

Browse files
committed
small improvments
1 parent e8e5772 commit 7a77a7f

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ create or replace package body ut_compound_data_helper is
401401
select
402402
exp_item_data, exp_data_id, item_no rn, rownum col_no, pk_value,
403403
s.column_value col, s.column_value.getRootElement() col_name,
404-
s.column_value.getclobval() col_val
404+
nvl(s.column_value.getclobval(),empty_clob()) col_val
405405
from (
406406
select
407407
exp_data_id, extract( ucd.exp_item_data, :column_path ) exp_item_data, item_no,
@@ -416,7 +416,7 @@ create or replace package body ut_compound_data_helper is
416416
select
417417
act_item_data, act_data_id, item_no rn, rownum col_no, pk_value,
418418
s.column_value col, s.column_value.getRootElement() col_name,
419-
s.column_value.getclobval() col_val
419+
nvl(s.column_value.getclobval(),empty_clob()) col_val
420420
from (
421421
select
422422
act_data_id, extract( ucd.act_item_data, :column_path ) act_item_data, item_no,

source/expectations/matchers/ut_equal.tpb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ create or replace type body ut_equal as
237237
l_result varchar2(32767);
238238
begin
239239
if self.expected.data_type = a_actual.data_type and self.expected.is_diffable then
240-
--TODO : Refactor
241240
if self.expected is of (ut_data_value_refcursor) then
242241
l_result :=
243242
'Actual: '||a_actual.get_object_info()||' '||self.description()||': '||self.expected.get_object_info()

test/core/expectations/test_expectations_cursor.pkb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,5 +2465,19 @@ Diff:%
24652465
ut.expect(l_actual_message).to_be_like(l_expected_message);
24662466
end;
24672467

2468+
procedure fixes_827_null_on_lob_compare is
2469+
l_actual sys_refcursor;
2470+
l_expected sys_refcursor;
2471+
begin
2472+
--Arrange
2473+
open l_actual for select rownum as rn, case when rownum = 2 then null else 'Row'||rownum end as rowdesc
2474+
from dual a connect by level < 3;
2475+
open l_expected for select rownum as rn, 'Row'||rownum as rowdesc from dual a connect by level < 3;
2476+
2477+
ut3.ut.expect(l_actual).to_equal(l_expected);
2478+
--Assert
2479+
ut.expect(expectations.failed_expectations_data()).to_be_empty();
2480+
end;
2481+
24682482
end;
24692483
/

test/core/expectations/test_expectations_cursor.pks

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,5 +391,8 @@ create or replace package test_expectations_cursor is
391391
--%test(Cursor to contain duplicates fail)
392392
procedure to_contain_duplicates_fail;
393393

394+
--%test( Fixes error 827 when lob compare fails on null)
395+
procedure fixes_827_null_on_lob_compare;
396+
394397
end;
395398
/

0 commit comments

Comments
 (0)