Skip to content

Commit ba8e9e2

Browse files
committed
Update documentation and tests for implicit cursor name.
1 parent 3f11a97 commit ba8e9e2

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

docs/userguide/advanced_data_comparison.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Each item in the comma separated list can be:
2929
- an attribute name of object type to be compared
3030
- an attribute name of object type within a table of objects to be compared
3131
- an [XPath](http://zvon.org/xxl/XPathTutorial/Output/example1.html) expression representing column/attribute
32+
- Include and exclude option will not support implicit colum names that starts with single quota, or in fact any other special characters e.g. <, >, &
3233

3334
Each element in `ut_varchar2_list` nested table can be an item or a comma separated list of items.
3435

test/core/expectations/compound_data/test_expectations_cursor.pkb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,5 +1004,42 @@ Rows: [ 2 differences ]%
10041004
ut.expect(expectations.failed_expectations_data()).to_be_empty();
10051005
end;
10061006

1007+
1008+
procedure include_col_name_implicit is
1009+
l_actual SYS_REFCURSOR;
1010+
l_expected SYS_REFCURSOR;
1011+
begin
1012+
--Arrange
1013+
open l_actual for select rownum as rn, 'a', 'c' as A_COLUMN, 'x' SOME_COL, 'd' "Some_Col" from dual a connect by level < 4;
1014+
open l_expected for select rownum as rn, 'a', 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
1015+
begin
1016+
--Act
1017+
ut3.ut.expect(l_actual).to_equal(l_expected).include(q'!/ROW/RN,'a',//SOME_COL!');
1018+
--Assert
1019+
ut.fail('Expected exception but nothing was raised');
1020+
exception
1021+
when others then
1022+
ut.expect(sqlcode).to_be_between(-31013,-31011);
1023+
end;
1024+
end;
1025+
1026+
procedure exclude_col_name_implicit is
1027+
l_actual SYS_REFCURSOR;
1028+
l_expected SYS_REFCURSOR;
1029+
begin
1030+
--Arrange
1031+
open l_actual for select rownum as rn, 'a', 'c' as A_COLUMN, 'x' SOME_COL, 'd' "Some_Col" from dual a connect by level < 4;
1032+
open l_expected for select rownum as rn, 'a', 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
1033+
begin
1034+
--Act
1035+
ut3.ut.expect(l_actual).to_equal(l_expected).exclude(q'!/ROW/RN,'a',//SOME_COL!');
1036+
--Assert
1037+
ut.fail('Expected exception but nothing was raised');
1038+
exception
1039+
when others then
1040+
ut.expect(sqlcode).to_be_between(-31013,-31011);
1041+
end;
1042+
end;
1043+
10071044
end;
10081045
/

test/core/expectations/compound_data/test_expectations_cursor.pks

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ create or replace package test_expectations_cursor is
192192

193193
--%test(Reports column match on cursor with column name implicit )
194194
procedure col_mtch_on_col_name_implicit;
195-
195+
196+
--%test( Fail on passing implicit column name as include filter )
197+
procedure include_col_name_implicit;
198+
199+
--%test( Fail on passing implicit column name as exclude filter )
200+
procedure exclude_col_name_implicit;
201+
196202
end;
197203
/

0 commit comments

Comments
 (0)