Skip to content

Commit b094911

Browse files
committed
Update tests
1 parent 1356f39 commit b094911

6 files changed

Lines changed: 27 additions & 7 deletions

File tree

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ create or replace package body ut_compound_data_helper is
665665
end if;
666666
ut_utils.append_to_clob(l_compare_sql,l_temp_string);
667667

668-
--dbms_output.put_line(l_compare_sql);
668+
dbms_output.put_line(l_compare_sql);
669669
return l_compare_sql;
670670
end;
671671

source/expectations/data_values/ut_data_value_refcursor.tpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ create or replace type body ut_data_value_refcursor as
249249
end if;
250250

251251

252-
if l_result = 0 then
252+
if l_result = 0 then
253253
if (self.cursor_details is not null and l_actual.cursor_details is not null) and (self.cursor_details != l_actual.cursor_details) then
254254
l_result := 1;
255255
end if;

source/expectations/matchers/ut_include.tpb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ create or replace type body ut_include as
6464
return l_result;
6565
end;
6666

67+
overriding member function run_matcher_negated(self in out nocopy ut_include, a_actual ut_data_value) return boolean is
68+
begin
69+
return run_matcher(a_actual);
70+
end;
71+
6772
overriding member function failure_message(a_actual ut_data_value) return varchar2 is
6873
l_result varchar2(32767);
6974
l_actual ut_data_value;

source/expectations/matchers/ut_include.tps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ create or replace type ut_include under ut_equal(
3030
member function negated return ut_include,
3131
member function get_negated return boolean,
3232
overriding member function run_matcher(self in out nocopy ut_include, a_actual ut_data_value) return boolean,
33+
overriding member function run_matcher_negated(self in out nocopy ut_include, a_actual ut_data_value) return boolean,
3334
overriding member function failure_message(a_actual ut_data_value) return varchar2,
3435
overriding member function failure_message_when_negated(a_actual ut_data_value) return varchar2
3536
)

test/core/expectations/test_expectations_cursor.pkb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,14 +2467,28 @@ Diff:%
24672467
procedure not_inc_join_incl_cols_as_lst is
24682468
l_actual sys_refcursor;
24692469
l_expected sys_refcursor;
2470+
l_expected_message varchar2(32767);
2471+
l_actual_message varchar2(32767);
24702472
begin
24712473
--Arrange
24722474
open l_actual for select rownum as rn, 'b' as "A_Column", 'c' as A_COLUMN, 'x' SOME_COL, 'd' "Some_Col" from dual a connect by level < 10;
24732475
open l_expected for select rownum as rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
24742476
--Act
24752477
ut3.ut.expect(l_actual).not_to_include(l_expected).include(ut3.ut_varchar2_list('RN','//A_Column','SOME_COL')).join_by('RN');
24762478
--Assert
2477-
ut.expect(expectations.failed_expectations_data()).to_be_empty();
2479+
l_expected_message := q'[%Actual: (refcursor [ count = 9 ])
2480+
%Data-types:
2481+
%<ROW><RN xml_valid_name="RN">NUMBER</RN><A_Column xml_valid_name="A_Column">CHAR</A_Column><A_COLUMN xml_valid_name="A_COLUMN">CHAR</A_COLUMN><SOME_COL xml_valid_name="SOME_COL">CHAR</SOME_COL><Some_Col xml_valid_name="Some_Col">CHAR</Some_Col></ROW>
2482+
%Data:
2483+
%<ROW>%</ROW>
2484+
%was expected not to include:(refcursor [ count = 3 ])
2485+
%Data-types:
2486+
%<ROW><RN xml_valid_name="RN">NUMBER</RN><A_Column xml_valid_name="A_Column">CHAR</A_Column><A_COLUMN xml_valid_name="A_COLUMN">CHAR</A_COLUMN><SOME_COL xml_valid_name="SOME_COL">CHAR</SOME_COL><Some_Col xml_valid_name="Some_Col">CHAR</Some_Col></ROW>
2487+
%Data:
2488+
%<ROW><RN>1</RN><A_Column>a</A_Column><A_COLUMN>d</A_COLUMN><SOME_COL>x</SOME_COL><Some_Col>c</Some_Col></ROW><ROW><RN>2</RN><A_Column>a</A_Column><A_COLUMN>d</A_COLUMN><SOME_COL>x</SOME_COL><Some_Col>c</Some_Col></ROW><ROW><RN>3</RN><A_Column>a</A_Column><A_COLUMN>d</A_COLUMN><SOME_COL>x</SOME_COL><Some_Col>c</Some_Col></ROW>]';
2489+
l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
2490+
--Assert
2491+
ut.expect(l_actual_message).to_be_like(l_expected_message);
24782492
end;
24792493

24802494
procedure not_cont_join_incl_cols_as_lst is
@@ -2483,7 +2497,7 @@ Diff:%
24832497
begin
24842498
--Arrange
24852499
open l_actual for select rownum as rn, 'b' as "A_Column", 'c' as A_COLUMN, 'x' SOME_COL, 'd' "Some_Col" from dual a connect by level < 10;
2486-
open l_expected for select rownum as rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
2500+
open l_expected for select rownum * 20 rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
24872501
--Act
24882502
ut3.ut.expect(l_actual).not_to_contain(l_expected).include(ut3.ut_varchar2_list('RN','//A_Column','SOME_COL')).join_by('RN');
24892503
--Assert
@@ -2496,7 +2510,7 @@ Diff:%
24962510
begin
24972511
--Arrange
24982512
open l_actual for select rownum as rn, 'a' as "A_Column", 'c' as A_COLUMN, 'y' SOME_COL, 'd' "Some_Col" from dual a connect by level < 10;
2499-
open l_expected for select rownum as rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
2513+
open l_expected for select rownum * 20 as rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
25002514
--Act
25012515
ut3.ut.expect(l_actual).not_to_include(l_expected).exclude(ut3.ut_varchar2_list('//Some_Col','A_COLUMN')).join_by('RN');
25022516
--Assert
@@ -2509,7 +2523,7 @@ Diff:%
25092523
begin
25102524
--Arrange
25112525
open l_actual for select rownum as rn, 'a' as "A_Column", 'c' as A_COLUMN, 'y' SOME_COL, 'd' "Some_Col" from dual a connect by level < 10;
2512-
open l_expected for select rownum as rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
2526+
open l_expected for select rownum * 20 as rn, 'a' as "A_Column", 'd' as A_COLUMN, 'x' SOME_COL, 'c' "Some_Col" from dual a connect by level < 4;
25132527
--Act
25142528
ut3.ut.expect(l_actual).not_to_contain(l_expected).exclude(ut3.ut_varchar2_list('//Some_Col','A_COLUMN')).join_by('RN');
25152529
--Assert

test/core/expectations/test_expectations_cursor.pks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ create or replace package test_expectations_cursor is
391391
--%test( Cursor not include data from another cursor with joinby clause)
392392
procedure cursor_not_to_include_joinby;
393393

394-
--%test(Cursor not include data with of columns to include and join by value)
394+
--%test(Cursor not include data with of columns to include and join by value - Fail)
395395
procedure not_inc_join_incl_cols_as_lst;
396396

397397
--%test(Cursor not contains data with of columns to include and join by value)

0 commit comments

Comments
 (0)