Skip to content

Commit 39ff2ed

Browse files
committed
Adding tests for issue 1293
1 parent 31604c6 commit 39ff2ed

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

test/ut3_user/expectations/test_expectations_cursor.pkb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,5 +2950,47 @@ Rows: [ 2 differences ]
29502950
);
29512951
end;
29522952

2953+
procedure cursor_joinby_compare_issue_1293 is
2954+
l_actual sys_refcursor;
2955+
l_expected sys_refcursor;
2956+
begin
2957+
--Arrange
2958+
open l_expected for
2959+
select 'FOO' username, 12 from dual union all
2960+
select 'TEST' username, -600 user_id from dual
2961+
order by 1 desc;
2962+
open l_actual for
2963+
select 'FOO' username, 12 from dual union all
2964+
select 'TEST' username, -600 user_id from dual union all
2965+
-- DUPLICATE!!!
2966+
select 'TEST' username, -600 user_id from dual
2967+
order by 1 asc;
2968+
--Act
2969+
ut3_develop.ut.expect(l_actual).to_equal(l_expected).join_by('USERNAME');
2970+
--Assert
2971+
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
2972+
end;
2973+
2974+
procedure cursor_not_joinby_compare_issue_1293 is
2975+
l_actual sys_refcursor;
2976+
l_expected sys_refcursor;
2977+
begin
2978+
--Arrange
2979+
open l_expected for
2980+
select 'FOO' username, 12 from dual union all
2981+
select 'TEST' username, -600 user_id from dual
2982+
order by 1 desc;
2983+
open l_actual for
2984+
select 'FOO' username, 12 from dual union all
2985+
select 'TEST' username, -600 user_id from dual union all
2986+
-- DUPLICATE!!!
2987+
select 'TEST' username, -600 user_id from dual
2988+
order by 1 asc;
2989+
--Act
2990+
ut3_develop.ut.expect(l_actual).to_equal(l_expected);
2991+
--Assert
2992+
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
2993+
end;
2994+
29532995
end;
29542996
/

test/ut3_user/expectations/test_expectations_cursor.pks

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,5 +485,11 @@ create or replace package test_expectations_cursor is
485485
--%test( Multiple failures reported correctly - Issue #998 )
486486
procedure multiple_cursor_expectations;
487487

488+
--%test( Compares cursors with duplicate rows using join by - Issue #1293 )
489+
procedure cursor_joinby_compare_issue_1293;
490+
491+
--%test( Compares cursors with duplicate rows - Issue #1293 )
492+
procedure cursor_not_joinby_compare_issue_1293;
493+
488494
end;
489495
/

0 commit comments

Comments
 (0)