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

Skip to content

Commit f77f13a

Browse files
committed
Update to test and docs
1 parent 4d8b964 commit f77f13a

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

docs/userguide/advanced_data_comparison.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ You can now join two cursors by defining a primary key or composite key that wil
143143

144144
Join by option can be used in conjunction with include or exclude options. However if any of the join keys is part of exclude set, comparison will fail and report to user that sets could not be joined on specific key (excluded).
145145

146+
Join by options currently doesn't support nested table inside cursor.
147+
146148
```sql
147149
procedure join_by_username is
148150
l_actual sys_refcursor;

test/core/expectations/compound_data/test_expectations_cursor.pkb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,5 +1696,40 @@ Diff:%
16961696
--Assert
16971697
ut.expect(l_actual_message).to_be_like(l_expected_message);
16981698
end;
1699+
1700+
procedure comparet_tabtype_as_cols_jb is
1701+
l_actual sys_refcursor;
1702+
l_expected sys_refcursor;
1703+
l_actual_tab ut3.ut_key_value_pairs := ut3.ut_key_value_pairs();
1704+
l_expected_tab ut3.ut_key_value_pairs := ut3.ut_key_value_pairs();
1705+
l_expected_message varchar2(32767);
1706+
l_actual_message varchar2(32767);
1707+
begin
1708+
select ut3.ut_key_value_pair(rownum,'Something '||rownum)
1709+
bulk collect into l_actual_tab
1710+
from dual connect by level <=2;
1711+
1712+
select ut3.ut_key_value_pair(rownum,'Somethings '||rownum)
1713+
bulk collect into l_expected_tab
1714+
from dual connect by level <=2;
1715+
1716+
--Arrange
1717+
open l_actual for select rownum rn, l_actual_tab
1718+
from dual connect by level <=2;
1719+
1720+
open l_expected for select key,value
1721+
from table(l_expected_tab) order by 1 desc;
1722+
1723+
--Act
1724+
ut3.ut.expect(l_actual).to_equal(l_expected).join_by(ut3.ut_varchar2_list('RN,L_ACTUAL_TAB/KEY'));
1725+
ut3.ut.fail('Expected Exception');
1726+
exception
1727+
when others then
1728+
l_expected_message := q'[%PLS-00306: wrong number or types of arguments in call to 'CONVERTOBJECT'%]';
1729+
l_actual_message := SQLERRM;
1730+
--Assert
1731+
ut.expect(l_actual_message).to_be_like(l_expected_message);
1732+
end;
1733+
16991734
end;
17001735
/

test/core/expectations/compound_data/test_expectations_cursor.pks

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,8 @@ create or replace package test_expectations_cursor is
292292
--%test(Compare table type join by multiple columns- Failure)
293293
procedure compare_nest_tab_cols_jb_fail;
294294

295+
--%test(Compare table type as column join by multiple columns - PLS Failure)
296+
procedure comparet_tabtype_as_cols_jb;
297+
295298
end;
296299
/

0 commit comments

Comments
 (0)