diff --git a/docs/userguide/expectations.md b/docs/userguide/expectations.md index 1f3ff9d33..6c7b71fa2 100644 --- a/docs/userguide/expectations.md +++ b/docs/userguide/expectations.md @@ -6,6 +6,7 @@ To do that we use concept of expectation and a matcher to perform the check on t Example of unit test procedure body with a single expectation. ```sql begin + ut.expect( 'the tested value' ).to_equal('the expected value'); ut.expect( 'the tested value' ).to_( equal('the expected value') ); end; ``` @@ -19,6 +20,11 @@ Pseudo-code: ut.expect( a_actual {data-type} ).not_to( {matcher} ); ``` +All matchers have shortcuts like: +```sql + ut.expect( a_actual {data-type} ).to_{matcher}; + ut.expect( a_actual {data-type} ).not_to_{matcher}; +``` # Matchers utPLSQL provides following matchers to perform checks on the expected and actual values. @@ -42,8 +48,11 @@ Validates that the actual value is between the lower and upper bound. Example: ```sql begin + ut.expect( a_actual => 3 ).to_be_between( a_lower_bound => 1, a_upper_bound => 3 ); + ut.expect( 3 ).to_be_between( 1, 3 ); + --or ut.expect( a_actual => 3 ).to_( be_between( a_lower_bound => 1, a_upper_bound => 3 ) ); - ut.expect( 3 ).to_( be_between( 1, 3 ) ); + ut.expect( 3 ).to_( be_between( 1, 3 ) ); end; ``` @@ -56,6 +65,8 @@ procedure test_if_cursor_is_empty is l_cursor sys_refcursor; begin open l_cursor for select * from dual where 1 = 0; + ut.expect( l_cursor ).to_be_empty(); + --or ut.expect( l_cursor ).to_( be_empty() ); end; ``` @@ -68,6 +79,8 @@ Unary matcher that validates if the provided value is false. Usage: ```sql begin + ut.expect( ( 1 = 0 ) ).to_be_false(); + --or ut.expect( ( 1 = 0 ) ).to_( be_false() ); end; ``` @@ -78,6 +91,8 @@ Allows to check if the actual value is greater or equal than the expected. Usage: ```sql begin + ut.expect( sysdate ).to_be_greater_or_equal( sysdate - 1 ); + --or ut.expect( sysdate ).to_( be_greater_or_equal( sysdate - 1 ) ); end; ``` @@ -88,6 +103,8 @@ Allows to check if the actual value is greater than the expected. Usage: ```sql begin + ut.expect( 2 ).to_be_greater_than( 1 ); + --or ut.expect( 2 ).to_( be_greater_than( 1 ) ); end; ``` @@ -98,6 +115,8 @@ Allows to check if the actual value is less or equal than the expected. Usage: ```sql begin + ut.expect( 3 ).to_be_less_or_equal( 3 ); + --or ut.expect( 3 ).to_( be_less_or_equal( 3 ) ); end; ``` @@ -108,6 +127,8 @@ Allows to check if the actual value is less than the expected. Usage: ```sql begin + ut.expect( 3 ).to_be_less_than( 2 ); + --or ut.expect( 3 ).to_( be_less_than( 2 ) ); end; ``` @@ -119,6 +140,9 @@ Validates that the actual value is like the expected expression. Usage: ```sql begin + ut.expect( 'Lorem_impsum' ).to_be_like( a_mask => '%rem\_%', a_escape_char => '\' ); + ut.expect( 'Lorem_impsum' ).to_be_like( '%rem\_%', '\' ); + --or ut.expect( 'Lorem_impsum' ).to_( be_like( a_mask => '%rem\_%', a_escape_char => '\' ) ); ut.expect( 'Lorem_impsum' ).to_( be_like( '%rem\_%', '\' ) ); end; @@ -133,7 +157,11 @@ Unary matcher that validates if the actual value is not null. Usage: ```sql begin + ut.expect( to_clob('ABC') ).to_be_not_null(); + --or ut.expect( to_clob('ABC') ).to_( be_not_null() ); + --or + ut.expect( to_clob('ABC') ).not_to( be_null() ); end; ``` @@ -143,6 +171,8 @@ Unary matcher that validates if the actual value is null. Usage: ```sql begin + ut.expect( cast(null as varchar2(100)) ).to_be_null(); + --or ut.expect( cast(null as varchar2(100)) ).to_( be_null() ); end; ``` @@ -154,6 +184,8 @@ Unary matcher that validates if the provided value is false. Usage: ```sql begin + ut.expect( ( 1 = 1 ) ).to_be_true(); + --or ut.expect( ( 1 = 1 ) ).to_( be_true() ); end; ``` @@ -171,6 +203,9 @@ procedure check_if_cursors_are_equal is x sys_refcursor; y sys_refcursor; begin + ut.expect( 'a dog' ).to_equal( 'a dog' ); + ut.expect( a_actual => y ).to_equal( a_expected => x, a_nulls_are_equal => true ); + --or ut.expect( 'a dog' ).to_( equal( 'a dog' ) ); ut.expect( a_actual => y ).to_( equal( a_expected => x, a_nulls_are_equal => true ) ); end; @@ -193,7 +228,7 @@ procedure test_cursors_skip_columns is begin open x for select 'text' ignore_me, d.* from user_tables d; open y for select sysdate "ADate", d.* from user_tables d; - ut.expect( a_actual => y ).to_( equal( a_expected => x, a_exclude => 'IGNORE_ME,ADate' ) ); + ut.expect( a_actual => y ).to_equal( a_expected => x, a_exclude => 'IGNORE_ME,ADate' ); end; ``` @@ -261,8 +296,8 @@ create or replace package body test_get_events is l_actual := get_events(gc_event_date-1, gc_event_date+1); ut.reset_nls(); - ut.expect(l_actual).to_( equal(l_expected) ); - ut.expect(l_actual).not_to( equal(l_expected_bad_date) ); + ut.expect(l_actual).to_equal(l_expected); + ut.expect(l_actual).not_to_equal(l_expected_bad_date); end; end; @@ -309,7 +344,7 @@ create or replace package body demo_dept as begin v_expected := department('HR'); v_actual := department('IT'); - ut.expect( anydata.convertObject(v_expected) ).to_( equal( anydata.convertObject(v_actual) ) ); + ut.expect( anydata.convertObject(v_expected) ).to_equal( anydata.convertObject(v_actual) ); end; procedure test_department is @@ -318,7 +353,7 @@ create or replace package body demo_dept as begin v_expected := departments(department('HR')); v_actual := departments(department('IT')); - ut.expect( anydata.convertCollection(v_expected) ).to_( equal( anydata.convertCollection(v_actual) ) ); + ut.expect( anydata.convertCollection(v_expected) ).to_equal( anydata.convertCollection(v_actual) ); end; end; @@ -333,6 +368,9 @@ Validates that the actual value is matching the expected regular expression. Usage: ```sql begin + ut.expect( a_actual => '123-456-ABcd' ).to_match( a_pattern => '\d{3}-\d{3}-[a-z]', a_modifiers => 'i' ); + ut.expect( 'some value' ).to_match( '^some.*' ); + --or ut.expect( a_actual => '123-456-ABcd' ).to_( match( a_pattern => '\d{3}-\d{3}-[a-z]', a_modifiers => 'i' ) ); ut.expect( 'some value' ).to_( match( '^some.*' ) ); end; @@ -370,13 +408,15 @@ Expectations provide a very convenient way to check for a negative of the expect Syntax of check for matcher evaluating to true: ```sql begin + ut.expect( a_actual {data-type} ).to_{matcher}; ut.expect( a_actual {data-type} ).to_( {matcher} ); end; ``` Syntax of check for matcher evaluating to false: ```sql -begin +begin + ut.expect( a_actual {data-type} ).not_to_{matcher}; ut.expect( a_actual {data-type} ).not_to( {matcher} ); end; ``` diff --git a/examples/RunWithDocumentationReporter.sql b/examples/RunWithDocumentationReporter.sql index aa537f1f9..84a863f1f 100644 --- a/examples/RunWithDocumentationReporter.sql +++ b/examples/RunWithDocumentationReporter.sql @@ -28,16 +28,16 @@ create or replace package body demo_doc_reporter1 is procedure test_without_name is begin - ut.expect(1).to_(equal(1)); + ut.expect(1).to_equal(1); end; procedure failing_test is begin - ut.expect(1).to_(equal(2)); + ut.expect(1).to_equal(2); end; procedure failing_no_name is begin - ut.expect(sysdate).to_(equal(to_char(sysdate))); + ut.expect(sysdate).to_equal(to_char(sysdate)); end; procedure failing_exception_raised is l_date date; @@ -77,7 +77,7 @@ create or replace package body suite_package_without_name is procedure passing_test2 is begin - ut.expect(1).to_(equal(1)); + ut.expect(1).to_equal(1); end; end; / diff --git a/examples/award_bonus/test_award_bonus.pkg b/examples/award_bonus/test_award_bonus.pkg index 0c313d219..7be8fcfd4 100644 --- a/examples/award_bonus/test_award_bonus.pkg +++ b/examples/award_bonus/test_award_bonus.pkg @@ -47,21 +47,21 @@ create or replace package body test_award_bonus as select salary as new_salary from employees_test where employee_id = gc_test_employee; - ut.expect( results ).to_( equal( expected ) ); + ut.expect( results ).to_equal( expected ); open results for select * from employees_test where employee_id != gc_test_employee; - ut.expect( results ).to_( equal( not_affected ) ); + ut.expect( results ).to_equal( not_affected ); end; procedure fail_on_null_bonus is begin award_bonus(emp_id => gc_test_employee, sales_amt => null); - ut.expect( sqlcode ).not_to( equal( 0 ) ); + ut.expect( sqlcode ).not_to_equal( 0 ); exception when others then - ut.expect( sqlcode ).not_to( equal( 0 ) ); + ut.expect( sqlcode ).not_to_equal( 0 ); end; procedure add_employee( emp_id number, comm_pct number, sal number ) is diff --git a/examples/between_string/test_betwnstr.pkg b/examples/between_string/test_betwnstr.pkg index 059364cd5..84f153ecc 100644 --- a/examples/between_string/test_betwnstr.pkg +++ b/examples/between_string/test_betwnstr.pkg @@ -29,22 +29,22 @@ create or replace package body test_betwnstr as procedure zero_start_position is begin - ut.expect( betwnstr( '1234567', 0, 5 ) ).to_( equal('12345') ); + ut.expect( betwnstr( '1234567', 0, 5 ) ).to_equal('12345'); end; procedure big_end_position is begin - ut.expect( betwnstr( '1234567', 0, 500 ) ).to_( equal('1234567') ); + ut.expect( betwnstr( '1234567', 0, 500 ) ).to_equal('1234567'); end; procedure null_string is begin - ut.expect( betwnstr( null, 2, 5 ) ).to_( be_null ); + ut.expect( betwnstr( null, 2, 5 ) ).to_be_null; end; procedure disabled_test is begin - ut.expect( betwnstr( null, null, null) ).not_to( be_null ); + ut.expect( betwnstr( null, null, null) ).not_to_be_null; end; end; diff --git a/examples/demo_expectations.pck b/examples/demo_expectations.pck index 4d45478d3..bf2cc93cf 100644 --- a/examples/demo_expectations.pck +++ b/examples/demo_expectations.pck @@ -546,6 +546,12 @@ create or replace package body demo_expectations is ut.expect(sysdate).not_to( be_between(sysdate+1,sysdate+2) ); ut.expect( 1 ).not_to( equal( 2 ) ); ut.expect( 'asd' ).not_to( be_like('z%q') ); + + ut.expect( sysdate ).not_to_be_null(); + ut.expect( to_char(null) ).not_to_be_not_null(); + ut.expect(sysdate).not_to_be_between(sysdate+1,sysdate+2); + ut.expect( 1 ).not_to_equal( 2 ); + ut.expect( 'asd' ).not_to_be_like('z%q'); end; end; diff --git a/examples/demo_of_expectations/demo_equal_matcher.sql b/examples/demo_of_expectations/demo_equal_matcher.sql index e0cec019a..fdc438204 100644 --- a/examples/demo_of_expectations/demo_equal_matcher.sql +++ b/examples/demo_of_expectations/demo_equal_matcher.sql @@ -63,7 +63,7 @@ create or replace package body demo_equal_matcher as l_expected := demo_department('Sales'); --get the actual data l_actual := demo_department('Sales'); - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected)) + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected) ); end; @@ -75,7 +75,7 @@ create or replace package body demo_equal_matcher as l_expected := demo_department('Sales'); --get the actual data -- nothing done - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected)) + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected) ); end; @@ -84,24 +84,21 @@ create or replace package body demo_equal_matcher as l_actual demo_department; begin l_actual := demo_department('Sales'); - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected)) - ); + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected)); end; procedure object_compare_null_both_ok is l_expected demo_department; l_actual demo_department; begin - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected)) - ); + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected)); end; procedure object_compare_null_both_fail is l_expected demo_department; l_actual demo_department; begin - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected),false) - ); + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected),false); end; @@ -113,8 +110,7 @@ create or replace package body demo_equal_matcher as l_expected := demo_department('Sales'); --get the actual data l_actual := demo_department('HR'); - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected)) - ); + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected)); end; procedure object_compare_different_type is @@ -125,8 +121,7 @@ create or replace package body demo_equal_matcher as l_expected := demo_department('Sales'); --get the actual data l_actual := demo_department_new('Sales'); - ut.expect(anydata.convertObject(l_actual)).to_(equal(anydata.convertObject(l_expected)) - ); + ut.expect(anydata.convertObject(l_actual)).to_equal(anydata.convertObject(l_expected)); end; end; diff --git a/examples/remove_rooms_by_name/test_remove_rooms_by_name.pkg b/examples/remove_rooms_by_name/test_remove_rooms_by_name.pkg index 8a8a66d92..7b88a471d 100644 --- a/examples/remove_rooms_by_name/test_remove_rooms_by_name.pkg +++ b/examples/remove_rooms_by_name/test_remove_rooms_by_name.pkg @@ -54,7 +54,7 @@ create or replace package body test_remove_rooms_by_name as remove_rooms_by_name('B%'); open l_remaining_rooms for select * from rooms; - ut.expect( l_remaining_rooms ).to_(equal(l_rooms_not_named_b)); + ut.expect( l_remaining_rooms ).to_equal(l_rooms_not_named_b); end; procedure room_with_content is @@ -65,15 +65,15 @@ create or replace package body test_remove_rooms_by_name as begin remove_rooms_by_name('Living Room'); - ut.expect( sqlcode ).to_( equal(-2292) ); + ut.expect( sqlcode ).to_equal(-2292); exception when others then - ut.expect( sqlcode ).to_( equal(-2292) ); + ut.expect( sqlcode ).to_equal(-2292); end; open l_remaining_rooms for select * from rooms; - ut.expect( l_remaining_rooms ).to_( equal( l_rooms ) ); + ut.expect( l_remaining_rooms ).to_equal( l_rooms ); end; procedure null_room_name is @@ -84,15 +84,15 @@ create or replace package body test_remove_rooms_by_name as begin remove_rooms_by_name(NULL); - ut.expect( sqlcode ).to_( equal(-6501) ); + ut.expect( sqlcode ).to_equal(-6501); exception when others then - ut.expect( sqlcode ).to_( equal(-6501) ); + ut.expect( sqlcode ).to_equal(-6501); end; open l_remaining_rooms for select * from rooms; - ut.expect( l_remaining_rooms ).to_( equal( l_rooms ) ); + ut.expect( l_remaining_rooms ).to_equal( l_rooms ); end; end; diff --git a/source/expectations/matchers/ut_be_between.tpb b/source/expectations/matchers/ut_be_between.tpb index c776f98c7..ec7480227 100644 --- a/source/expectations/matchers/ut_be_between.tpb +++ b/source/expectations/matchers/ut_be_between.tpb @@ -75,10 +75,16 @@ create or replace type body ut_be_between is end; overriding member function run_matcher(self in out nocopy ut_be_between, a_actual ut_data_value) return boolean is + l_lower_result boolean; + l_upper_result boolean; l_result boolean; begin if self.lower_bound.data_type = a_actual.data_type then - l_result := a_actual >= self.lower_bound and a_actual <= self.upper_bound; + l_lower_result := a_actual >= self.lower_bound; + l_upper_result := a_actual <= self.upper_bound; + if l_lower_result is not null and l_upper_result is not null then + l_result := l_lower_result and l_upper_result; + end if; else l_result := (self as ut_matcher).run_matcher(a_actual); end if; diff --git a/source/expectations/ut_expectation.tpb b/source/expectations/ut_expectation.tpb index 174c16a44..ff7e2552b 100644 --- a/source/expectations/ut_expectation.tpb +++ b/source/expectations/ut_expectation.tpb @@ -136,6 +136,90 @@ create or replace type body ut_expectation as ut_utils.debug_log('ut_expectation.to_be_not_null'); self.to_( ut_be_not_null() ); end; + + member procedure not_to_equal(self in ut_expectation, a_expected anydata, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected anydata, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected blob, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected blob, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected boolean, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected boolean, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected clob, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected clob, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_exclude, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude ut_varchar2_list, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude ut_varchar2_list, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_exclude, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; end; / diff --git a/source/expectations/ut_expectation.tps b/source/expectations/ut_expectation.tps index be87aaf33..d0e04e9d4 100644 --- a/source/expectations/ut_expectation.tps +++ b/source/expectations/ut_expectation.tps @@ -36,7 +36,22 @@ create or replace type ut_expectation authid current_user as object( member procedure to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null), member procedure to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null), member procedure to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null), - member procedure to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null) + member procedure to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null), + + member procedure not_to_equal(self in ut_expectation, a_expected anydata, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected blob, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected boolean, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected clob, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude ut_varchar2_list, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null) ) not final not instantiable / diff --git a/source/expectations/ut_expectation_anydata.tpb b/source/expectations/ut_expectation_anydata.tpb index 6f201b666..9d1d35a5d 100644 --- a/source/expectations/ut_expectation_anydata.tpb +++ b/source/expectations/ut_expectation_anydata.tpb @@ -26,6 +26,19 @@ create or replace type body ut_expectation_anydata as ut_utils.debug_log('ut_expectation_anydata.to_be_empty(self in ut_expectation_anydata)'); self.to_( ut_be_empty() ); end; + + overriding member procedure not_to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_anydata.not_to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_empty(self in ut_expectation_anydata) is + begin + ut_utils.debug_log('ut_expectation_anydata.not_to_be_empty(self in ut_expectation_anydata)'); + self.not_to( ut_be_empty() ); + end; + end; / diff --git a/source/expectations/ut_expectation_anydata.tps b/source/expectations/ut_expectation_anydata.tps index ef49af228..77bf209b3 100644 --- a/source/expectations/ut_expectation_anydata.tps +++ b/source/expectations/ut_expectation_anydata.tps @@ -16,6 +16,9 @@ create or replace type ut_expectation_anydata under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null), - member procedure to_be_empty(self in ut_expectation_anydata) + member procedure to_be_empty(self in ut_expectation_anydata), + + overriding member procedure not_to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null), + member procedure not_to_be_empty(self in ut_expectation_anydata) ) / diff --git a/source/expectations/ut_expectation_blob.tpb b/source/expectations/ut_expectation_blob.tpb index 09d13bddc..04568d600 100644 --- a/source/expectations/ut_expectation_blob.tpb +++ b/source/expectations/ut_expectation_blob.tpb @@ -20,6 +20,12 @@ create or replace type body ut_expectation_blob as ut_utils.debug_log('ut_expectation_blob.to_equal(self in ut_expectation, a_expected blob)'); self.to_( ut_equal(a_expected, a_nulls_are_equal) ); end; + + overriding member procedure not_to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_blob.not_to_equal(self in ut_expectation, a_expected blob)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; end; / diff --git a/source/expectations/ut_expectation_blob.tps b/source/expectations/ut_expectation_blob.tps index 2c51e5a68..00ab313ba 100644 --- a/source/expectations/ut_expectation_blob.tps +++ b/source/expectations/ut_expectation_blob.tps @@ -15,6 +15,7 @@ create or replace type ut_expectation_blob under ut_expectation( See the License for the specific language governing permissions and limitations under the License. */ - overriding member procedure to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null) + overriding member procedure to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null), + overriding member procedure not_to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null) ) / diff --git a/source/expectations/ut_expectation_boolean.tpb b/source/expectations/ut_expectation_boolean.tpb index 4c0578e84..47cc176ed 100644 --- a/source/expectations/ut_expectation_boolean.tpb +++ b/source/expectations/ut_expectation_boolean.tpb @@ -32,6 +32,24 @@ create or replace type body ut_expectation_boolean as ut_utils.debug_log('ut_expectation_boolean.to_be_false(self in ut_expectation_boolean)'); self.to_( ut_be_false() ); end; + + overriding member procedure not_to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_boolean.not_to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_true(self in ut_expectation_boolean) is + begin + ut_utils.debug_log('ut_expectation_boolean.not_to_be_true(self in ut_expectation_boolean)'); + self.not_to( ut_be_true() ); + end; + + member procedure not_to_be_false(self in ut_expectation_boolean) is + begin + ut_utils.debug_log('ut_expectation_boolean.not_to_be_false(self in ut_expectation_boolean)'); + self.not_to( ut_be_false() ); + end; end; / diff --git a/source/expectations/ut_expectation_boolean.tps b/source/expectations/ut_expectation_boolean.tps index 33849d354..bc52b3f16 100644 --- a/source/expectations/ut_expectation_boolean.tps +++ b/source/expectations/ut_expectation_boolean.tps @@ -17,6 +17,10 @@ create or replace type ut_expectation_boolean under ut_expectation( */ overriding member procedure to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null), member procedure to_be_true(self in ut_expectation_boolean), - member procedure to_be_false(self in ut_expectation_boolean) + member procedure to_be_false(self in ut_expectation_boolean), + + overriding member procedure not_to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null), + member procedure not_to_be_true(self in ut_expectation_boolean), + member procedure not_to_be_false(self in ut_expectation_boolean) ) / diff --git a/source/expectations/ut_expectation_clob.tpb b/source/expectations/ut_expectation_clob.tpb index 864891fef..be57e1fda 100644 --- a/source/expectations/ut_expectation_clob.tpb +++ b/source/expectations/ut_expectation_clob.tpb @@ -32,6 +32,24 @@ create or replace type body ut_expectation_clob as ut_utils.debug_log('ut_expectation_clob.to_match(self in ut_expectation, a_pattern in varchar2, a_modifiers in varchar2 default null)'); self.to_( ut_match(a_pattern, a_modifiers) ); end; + + overriding member procedure not_to_equal(self in ut_expectation_clob, a_expected clob, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_clob.not_to_equal(self in ut_expectation, a_expected clob)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_like(self in ut_expectation_clob, a_mask in varchar2, a_escape_char in varchar2 := null) is + begin + ut_utils.debug_log('ut_expectation_clob.not_to_be_like(self in ut_expectation, a_mask in varchar2, a_escape_char in varchar2 default null)'); + self.not_to( ut_be_like(a_mask, a_escape_char) ); + end; + + member procedure not_to_match(self in ut_expectation_clob, a_pattern in varchar2, a_modifiers in varchar2 default null) is + begin + ut_utils.debug_log('ut_expectation_clob.not_to_match(self in ut_expectation, a_pattern in varchar2, a_modifiers in varchar2 default null)'); + self.not_to( ut_match(a_pattern, a_modifiers) ); + end; end; / diff --git a/source/expectations/ut_expectation_clob.tps b/source/expectations/ut_expectation_clob.tps index d83b9cc0f..5beb8e50e 100644 --- a/source/expectations/ut_expectation_clob.tps +++ b/source/expectations/ut_expectation_clob.tps @@ -17,6 +17,10 @@ create or replace type ut_expectation_clob under ut_expectation( */ overriding member procedure to_equal(self in ut_expectation_clob, a_expected clob, a_nulls_are_equal boolean := null), member procedure to_be_like(self in ut_expectation_clob, a_mask in varchar2, a_escape_char in varchar2 := null), - member procedure to_match(self in ut_expectation_clob, a_pattern in varchar2, a_modifiers in varchar2 := null) + member procedure to_match(self in ut_expectation_clob, a_pattern in varchar2, a_modifiers in varchar2 := null), + + overriding member procedure not_to_equal(self in ut_expectation_clob, a_expected clob, a_nulls_are_equal boolean := null), + member procedure not_to_be_like(self in ut_expectation_clob, a_mask in varchar2, a_escape_char in varchar2 := null), + member procedure not_to_match(self in ut_expectation_clob, a_pattern in varchar2, a_modifiers in varchar2 := null) ) / diff --git a/source/expectations/ut_expectation_date.tpb b/source/expectations/ut_expectation_date.tpb index 11abd5ef2..7f64c3f59 100644 --- a/source/expectations/ut_expectation_date.tpb +++ b/source/expectations/ut_expectation_date.tpb @@ -26,6 +26,66 @@ create or replace type body ut_expectation_date as ut_utils.debug_log('ut_expectation_date.to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date)'); self.to_( ut_be_between(a_lower_bound,a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.to_be_greater_or_equal(self in ut_expectation_date, a_expected date)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + + member procedure to_be_greater_than(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.to_be_greater_than(self in ut_expectation_date, a_expected date)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + + member procedure to_be_less_or_equal(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.to_be_less_or_equal(self in ut_expectation_date, a_expected date)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + + member procedure to_be_less_than(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.to_be_less_than(self in ut_expectation_date, a_expected date'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_date, a_expected date, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_date.not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date) is + begin + ut_utils.debug_log('ut_expectation_date.not_to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date)'); + self.not_to( ut_be_between(a_lower_bound,a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.not_to_be_greater_or_equal(self in ut_expectation_date, a_expected date)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + + member procedure not_to_be_greater_than(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.not_to_be_greater_than(self in ut_expectation_date, a_expected date)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + + member procedure not_to_be_less_or_equal(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.not_to_be_less_or_equal(self in ut_expectation_date, a_expected date)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + + member procedure not_to_be_less_than(self in ut_expectation_date, a_expected date) is + begin + ut_utils.debug_log('ut_expectation_date.not_to_be_less_than(self in ut_expectation_date, a_expected date'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_date.tps b/source/expectations/ut_expectation_date.tps index e15c80e1c..a23f947ff 100644 --- a/source/expectations/ut_expectation_date.tps +++ b/source/expectations/ut_expectation_date.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_date under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_date, a_expected date, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date) + member procedure to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date), + member procedure to_be_greater_or_equal(self in ut_expectation_date, a_expected date), + member procedure to_be_greater_than(self in ut_expectation_date, a_expected date), + member procedure to_be_less_or_equal(self in ut_expectation_date, a_expected date), + member procedure to_be_less_than(self in ut_expectation_date, a_expected date), + + overriding member procedure not_to_equal(self in ut_expectation_date, a_expected date, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date), + member procedure not_to_be_greater_or_equal(self in ut_expectation_date, a_expected date), + member procedure not_to_be_greater_than(self in ut_expectation_date, a_expected date), + member procedure not_to_be_less_or_equal(self in ut_expectation_date, a_expected date), + member procedure not_to_be_less_than(self in ut_expectation_date, a_expected date) ) / diff --git a/source/expectations/ut_expectation_dsinterval.tpb b/source/expectations/ut_expectation_dsinterval.tpb index ad0556586..32c8f70ff 100644 --- a/source/expectations/ut_expectation_dsinterval.tpb +++ b/source/expectations/ut_expectation_dsinterval.tpb @@ -26,6 +26,60 @@ create or replace type body ut_expectation_dsinterval as ut_utils.debug_log('ut_expectation_dsinterval.to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)'); self.to_( ut_be_between(a_lower_bound,a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + member procedure to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + member procedure to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + member procedure to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)'); + self.not_to( ut_be_between(a_lower_bound,a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + member procedure not_to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + member procedure not_to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + member procedure not_to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_dsinterval.tps b/source/expectations/ut_expectation_dsinterval.tps index f576df896..d613dbdfb 100644 --- a/source/expectations/ut_expectation_dsinterval.tps +++ b/source/expectations/ut_expectation_dsinterval.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_dsinterval under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained) + member procedure to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained), + member procedure to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + member procedure to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + member procedure to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + member procedure to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + + overriding member procedure not_to_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained), + member procedure not_to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + member procedure not_to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + member procedure not_to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained), + member procedure not_to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) ) / diff --git a/source/expectations/ut_expectation_number.tpb b/source/expectations/ut_expectation_number.tpb index 1a7b68298..0300661d7 100644 --- a/source/expectations/ut_expectation_number.tpb +++ b/source/expectations/ut_expectation_number.tpb @@ -26,6 +26,66 @@ create or replace type body ut_expectation_number as ut_utils.debug_log('ut_expectation_number.to_be_between(self in ut_expectation_date, a_lower_bound number, a_upper_bound number)'); self.to_( ut_be_between(a_lower_bound,a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.to_be_greater_or_equal(self in ut_expectation_number, a_expected number)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + + member procedure to_be_greater_than(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.to_be_greater_than(self in ut_expectation_number, a_expected number)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + + member procedure to_be_less_or_equal(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.to_be_less_or_equal(self in ut_expectation_number, a_expected number)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + + member procedure to_be_less_than(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.to_be_less_than(self in ut_expectation_number, a_expected number'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_number, a_expected number, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_number.not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number) is + begin + ut_utils.debug_log('ut_expectation_number.not_to_be_between(self in ut_expectation_date, a_lower_bound number, a_upper_bound number)'); + self.not_to( ut_be_between(a_lower_bound,a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.not_to_be_greater_or_equal(self in ut_expectation_number, a_expected number)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + + member procedure not_to_be_greater_than(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.not_to_be_greater_than(self in ut_expectation_number, a_expected number)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + + member procedure not_to_be_less_or_equal(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.not_to_be_less_or_equal(self in ut_expectation_number, a_expected number)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + + member procedure not_to_be_less_than(self in ut_expectation_number, a_expected number) is + begin + ut_utils.debug_log('ut_expectation_number.not_to_be_less_than(self in ut_expectation_number, a_expected number'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_number.tps b/source/expectations/ut_expectation_number.tps index 3feeab798..61d9befb1 100644 --- a/source/expectations/ut_expectation_number.tps +++ b/source/expectations/ut_expectation_number.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_number under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_number, a_expected number, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number) + member procedure to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number), + member procedure to_be_greater_or_equal(self in ut_expectation_number, a_expected number), + member procedure to_be_greater_than(self in ut_expectation_number, a_expected number), + member procedure to_be_less_or_equal(self in ut_expectation_number, a_expected number), + member procedure to_be_less_than(self in ut_expectation_number, a_expected number), + + overriding member procedure not_to_equal(self in ut_expectation_number, a_expected number, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number), + member procedure not_to_be_greater_or_equal(self in ut_expectation_number, a_expected number), + member procedure not_to_be_greater_than(self in ut_expectation_number, a_expected number), + member procedure not_to_be_less_or_equal(self in ut_expectation_number, a_expected number), + member procedure not_to_be_less_than(self in ut_expectation_number, a_expected number) ) / diff --git a/source/expectations/ut_expectation_refcursor.tpb b/source/expectations/ut_expectation_refcursor.tpb index 799594d79..f52208f1c 100644 --- a/source/expectations/ut_expectation_refcursor.tpb +++ b/source/expectations/ut_expectation_refcursor.tpb @@ -26,5 +26,17 @@ create or replace type body ut_expectation_refcursor as ut_utils.debug_log('ut_expectation_refcursor.to_be_empty(self in ut_expectation_refcursor)'); self.to_( ut_be_empty() ); end; + + overriding member procedure not_to_equal(self in ut_expectation_refcursor, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_refcursor.not_to_equal(self in ut_expectation_refcursor, a_expected sys_refcursor, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_exclude, a_nulls_are_equal) ); + end; + + member procedure not_to_be_empty(self in ut_expectation_refcursor) is + begin + ut_utils.debug_log('ut_expectation_refcursor.not_to_be_empty(self in ut_expectation_refcursor)'); + self.not_to( ut_be_empty() ); + end; end; / diff --git a/source/expectations/ut_expectation_refcursor.tps b/source/expectations/ut_expectation_refcursor.tps index b1024baae..c698cc306 100644 --- a/source/expectations/ut_expectation_refcursor.tps +++ b/source/expectations/ut_expectation_refcursor.tps @@ -16,6 +16,9 @@ create or replace type ut_expectation_refcursor under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_refcursor, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null), - member procedure to_be_empty(self in ut_expectation_refcursor) + member procedure to_be_empty(self in ut_expectation_refcursor), + + overriding member procedure not_to_equal(self in ut_expectation_refcursor, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null), + member procedure not_to_be_empty(self in ut_expectation_refcursor) ) / diff --git a/source/expectations/ut_expectation_timestamp.tpb b/source/expectations/ut_expectation_timestamp.tpb index d6d89ffc7..15da53a4f 100644 --- a/source/expectations/ut_expectation_timestamp.tpb +++ b/source/expectations/ut_expectation_timestamp.tpb @@ -26,6 +26,66 @@ create or replace type body ut_expectation_timestamp as ut_utils.debug_log('ut_expectation_timestamp.to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained)'); self.to_( ut_be_between(a_lower_bound, a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + + member procedure to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + + member procedure to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + + member procedure to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_timestamp.not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.not_to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained)'); + self.not_to( ut_be_between(a_lower_bound, a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.not_to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + + member procedure not_to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.not_to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + + member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.not_to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + + member procedure not_to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp.not_to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_timestamp.tps b/source/expectations/ut_expectation_timestamp.tps index d7c35dfae..f2e934ba1 100644 --- a/source/expectations/ut_expectation_timestamp.tps +++ b/source/expectations/ut_expectation_timestamp.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_timestamp under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained) + member procedure to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained), + member procedure to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + member procedure to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + member procedure to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + member procedure to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + + overriding member procedure not_to_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained), + member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + member procedure not_to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained), + member procedure not_to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) ) / diff --git a/source/expectations/ut_expectation_timestamp_ltz.tpb b/source/expectations/ut_expectation_timestamp_ltz.tpb index 90839c748..fe34922f9 100644 --- a/source/expectations/ut_expectation_timestamp_ltz.tpb +++ b/source/expectations/ut_expectation_timestamp_ltz.tpb @@ -26,6 +26,60 @@ create or replace type body ut_expectation_timestamp_ltz as ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained)'); self.to_( ut_be_between(a_lower_bound, a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + member procedure to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + member procedure to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + member procedure to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained)'); + self.not_to( ut_be_between(a_lower_bound, a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + member procedure not_to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + member procedure not_to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_timestamp_ltz.tps b/source/expectations/ut_expectation_timestamp_ltz.tps index e40a0ada8..d078347b9 100644 --- a/source/expectations/ut_expectation_timestamp_ltz.tps +++ b/source/expectations/ut_expectation_timestamp_ltz.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_timestamp_ltz under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained) + member procedure to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained), + member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + member procedure to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + member procedure to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + member procedure to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + + overriding member procedure not_to_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained), + member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + member procedure not_to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained), + member procedure not_to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) ) / diff --git a/source/expectations/ut_expectation_timestamp_tz.tpb b/source/expectations/ut_expectation_timestamp_tz.tpb index 43ee74de4..170d3c06e 100644 --- a/source/expectations/ut_expectation_timestamp_tz.tpb +++ b/source/expectations/ut_expectation_timestamp_tz.tpb @@ -26,6 +26,60 @@ create or replace type body ut_expectation_timestamp_tz as ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained)'); self.to_( ut_be_between(a_lower_bound, a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + member procedure to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + member procedure to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + member procedure to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.not_to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained)'); + self.not_to( ut_be_between(a_lower_bound, a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.not_to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + member procedure not_to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.not_to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.not_to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + member procedure not_to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_timestamp_tz.not_to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_timestamp_tz.tps b/source/expectations/ut_expectation_timestamp_tz.tps index fade24b46..f3bb59398 100644 --- a/source/expectations/ut_expectation_timestamp_tz.tps +++ b/source/expectations/ut_expectation_timestamp_tz.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_timestamp_tz under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained) + member procedure to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained), + member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + member procedure to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + member procedure to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + member procedure to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + + overriding member procedure not_to_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained), + member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + member procedure not_to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained), + member procedure not_to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) ) / diff --git a/source/expectations/ut_expectation_varchar2.tpb b/source/expectations/ut_expectation_varchar2.tpb index b450ac343..aa367f891 100644 --- a/source/expectations/ut_expectation_varchar2.tpb +++ b/source/expectations/ut_expectation_varchar2.tpb @@ -38,6 +38,30 @@ create or replace type body ut_expectation_varchar2 as ut_utils.debug_log('ut_expectation_varchar2.to_match(self in ut_expectation, a_pattern in varchar2, a_modifiers in varchar2 default null)'); self.to_( ut_match(a_pattern, a_modifiers) ); end; + + overriding member procedure not_to_equal(self in ut_expectation_varchar2, a_expected varchar2, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_varchar2.not_to_equal(self in ut_expectation, a_expected varchar2)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_varchar2, a_lower_bound varchar2, a_upper_bound varchar2) is + begin + ut_utils.debug_log('ut_expectation_varchar2.not_to_be_between(self in ut_expectation_varchar2, a_lower_bound varchar2, a_upper_bound varchar2)'); + self.not_to( ut_be_between(a_lower_bound,a_upper_bound) ); + end; + + member procedure not_to_be_like(self in ut_expectation_varchar2, a_mask in varchar2, a_escape_char in varchar2 := null) is + begin + ut_utils.debug_log('ut_expectation_varchar2.not_to_be_like(self in ut_expectation, a_mask in varchar2, a_escape_char in varchar2 default null)'); + self.not_to( ut_be_like(a_mask, a_escape_char) ); + end; + + member procedure not_to_match(self in ut_expectation_varchar2, a_pattern in varchar2, a_modifiers in varchar2 default null) is + begin + ut_utils.debug_log('ut_expectation_varchar2.not_to_match(self in ut_expectation, a_pattern in varchar2, a_modifiers in varchar2 default null)'); + self.not_to( ut_match(a_pattern, a_modifiers) ); + end; end; / diff --git a/source/expectations/ut_expectation_varchar2.tps b/source/expectations/ut_expectation_varchar2.tps index 4ae11a000..59b84ff16 100644 --- a/source/expectations/ut_expectation_varchar2.tps +++ b/source/expectations/ut_expectation_varchar2.tps @@ -18,6 +18,11 @@ create or replace type ut_expectation_varchar2 under ut_expectation( overriding member procedure to_equal(self in ut_expectation_varchar2, a_expected varchar2, a_nulls_are_equal boolean := null), member procedure to_be_between(self in ut_expectation_varchar2, a_lower_bound varchar2, a_upper_bound varchar2), member procedure to_be_like(self in ut_expectation_varchar2, a_mask in varchar2, a_escape_char in varchar2 := null), - member procedure to_match(self in ut_expectation_varchar2, a_pattern in varchar2, a_modifiers in varchar2 := null) + member procedure to_match(self in ut_expectation_varchar2, a_pattern in varchar2, a_modifiers in varchar2 := null), + + overriding member procedure not_to_equal(self in ut_expectation_varchar2, a_expected varchar2, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_varchar2, a_lower_bound varchar2, a_upper_bound varchar2), + member procedure not_to_be_like(self in ut_expectation_varchar2, a_mask in varchar2, a_escape_char in varchar2 := null), + member procedure not_to_match(self in ut_expectation_varchar2, a_pattern in varchar2, a_modifiers in varchar2 := null) ) / diff --git a/source/expectations/ut_expectation_yminterval.tpb b/source/expectations/ut_expectation_yminterval.tpb index 064dddca0..b305322d2 100644 --- a/source/expectations/ut_expectation_yminterval.tpb +++ b/source/expectations/ut_expectation_yminterval.tpb @@ -26,6 +26,60 @@ create or replace type body ut_expectation_yminterval as ut_utils.debug_log('ut_expectation_yminterval.to_be_between(self in ut_expectation_yminterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)'); self.to_( ut_be_between(a_lower_bound,a_upper_bound) ); end; + + member procedure to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.to_( ut_be_greater_or_equal (a_expected) ); + end; + member procedure to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.to_( ut_be_greater_than (a_expected) ); + end; + member procedure to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.to_( ut_be_less_or_equal (a_expected) ); + end; + member procedure to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.to_( ut_be_less_than (a_expected) ); + end; + + overriding member procedure not_to_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null) is + begin + ut_utils.debug_log('ut_expectation_yminterval.not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained)'); + self.not_to( ut_equal(a_expected, a_nulls_are_equal) ); + end; + + member procedure not_to_be_between(self in ut_expectation_yminterval, a_lower_bound yminterval_unconstrained, a_upper_bound yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.not_to_be_between(self in ut_expectation_yminterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)'); + self.not_to( ut_be_between(a_lower_bound,a_upper_bound) ); + end; + + member procedure not_to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.not_to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.not_to( ut_be_greater_or_equal (a_expected) ); + end; + member procedure not_to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.not_to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.not_to( ut_be_greater_than (a_expected) ); + end; + member procedure not_to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.not_to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.not_to( ut_be_less_or_equal (a_expected) ); + end; + member procedure not_to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is + begin + ut_utils.debug_log('ut_expectation_yminterval.not_to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)'); + self.not_to( ut_be_less_than (a_expected) ); + end; end; / diff --git a/source/expectations/ut_expectation_yminterval.tps b/source/expectations/ut_expectation_yminterval.tps index 1e8c19cfb..e8db00310 100644 --- a/source/expectations/ut_expectation_yminterval.tps +++ b/source/expectations/ut_expectation_yminterval.tps @@ -16,6 +16,17 @@ create or replace type ut_expectation_yminterval under ut_expectation( limitations under the License. */ overriding member procedure to_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null), - member procedure to_be_between(self in ut_expectation_yminterval, a_lower_bound yminterval_unconstrained, a_upper_bound yminterval_unconstrained) + member procedure to_be_between(self in ut_expectation_yminterval, a_lower_bound yminterval_unconstrained, a_upper_bound yminterval_unconstrained), + member procedure to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + member procedure to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + member procedure to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + member procedure to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + + overriding member procedure not_to_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null), + member procedure not_to_be_between(self in ut_expectation_yminterval, a_lower_bound yminterval_unconstrained, a_upper_bound yminterval_unconstrained), + member procedure not_to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + member procedure not_to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + member procedure not_to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained), + member procedure not_to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) ) / diff --git a/tests/RunAll.sql b/tests/RunAll.sql index 8526a1762..37bbda675 100644 --- a/tests/RunAll.sql +++ b/tests/RunAll.sql @@ -42,17 +42,11 @@ exec ut_coverage.coverage_start_develop(); @@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationWithKeyValue.sql @@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationWithMultilineComment.sql -@@ut_expectations/ut.expect.to_be_between.GivesFailureForDifferentValues.sql -@@ut_expectations/ut.expect.to_be_between.GivesFailureWhenActualIsNull.sql -@@ut_expectations/ut.expect.to_be_between.GivesFailureWhenBothActualAndExpectedRangeIsNull.sql -@@ut_expectations/ut.expect.to_be_between.GivesFailureWhenExpectedRangeIsNull.sql -@@ut_expectations/ut.expect.to_be_between.GivesSuccessWhenDifferentTypes.sql -@@ut_expectations/ut.expect.to_be_between.GivesTrueForCorrectValues.sql -@@ut_expectations/ut.expect.to_be_between.with_text.GivesTheProvidedTextAsMessage.sql +@@lib/RunTest.sql ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNotBoolean.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNull.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsTrue.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_false.GivesSuccessWhenExpessionIsFalse.sql -@@ut_expectations/ut.expect.to_be_like.sql +@@lib/RunTest.sql ut_expectations/ut.expect.to_be_like.FailsForUnsupportedDatatype.sql @@ut_expectations/ut.expect.to_be_not_null.GivesFailureWhenActualIsNull.sql @@ut_expectations/ut.expect.to_be_not_null.GivesSuccessWhenActualIsNotNull.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_null.anydata.GivesSuccessWhenAnydataIsNull.sql @@ -62,6 +56,7 @@ exec ut_coverage.coverage_start_develop(); @@ut_expectations/ut.expect.to_be_null.GivesSuccessWhenActualIsNull.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_null.refcursor.GivesSuccessWhenCursorIsNull.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsFalse.sql +@@lib/RunTest.sql ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNotBoolean.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNull.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_be_true.GivesSuccessWhenExpessionIsTrue.sql @@lib/RunTest.sql ut_expectations/ut.expect.to_equal.anydata.GivesFailureWhenBothObjectsAreNullButDifferentType.sql @@ -98,16 +93,21 @@ exec ut_coverage.coverage_start_develop(); @@ut_expectations/ut.expect.to_equal.PutsNullIntoStringValueWhenActualIsNull.sql @@ut_expectations/ut.expect.to_equal.PutsNullIntoStringValueWhenExpectedIsNull.sql @@ut_expectations/ut.expect.to_equal.with_text.GivesTheProvidedTextAsMessage.sql -@@ut_expectations/ut.expect.to_match.sql +@@ut_expectations/ut.expect.not_to_equal.GivesFailureForDifferentDataTypes.sql +@@ut_expectations/ut.expect.not_to_equal.GivesFailureForEqualValues.sql +@@ut_expectations/ut.expect.not_to_equal.GivesSuccessForDifferentValues.sql +@@lib/RunTest.sql ut_expectations/ut.expect.to_match.FailsForUnsupportedDatatype.sql @@lib/RunTest.sql ut_expectations/ut_data_value_object.compare.Gives0WhenComparingIdenticalObjects.sql @@lib/RunTest.sql ut_expectations/ut_expectation_processor.nulls_are_equal.raisesExceptionWhenTryingToSetNullValue.sql @@ut_matchers/be_between.sql +@@ut_matchers/be_empty.sql +@@ut_matchers/be_like.sql @@ut_matchers/greater_or_equal.sql @@ut_matchers/greater_than.sql @@ut_matchers/less_or_equal.sql @@ut_matchers/less_than.sql -@@ut_matchers/be_empty.sql +@@ut_matchers/match.sql @@lib/RunTest.sql ut_matchers/timestamp_between.sql @@lib/RunTest.sql ut_matchers/timestamp_ltz_between.sql diff --git a/tests/helpers/test_package_1.pck b/tests/helpers/test_package_1.pck index d2b827109..8b221f354 100644 --- a/tests/helpers/test_package_1.pck +++ b/tests/helpers/test_package_1.pck @@ -1,6 +1,7 @@ create or replace package test_package_1 is --%suite + --%displayname(test_package_1) --%suitepath(tests) gv_glob_val number; diff --git a/tests/helpers/test_package_3.pck b/tests/helpers/test_package_3.pck index 262ea1935..11352369e 100644 --- a/tests/helpers/test_package_3.pck +++ b/tests/helpers/test_package_3.pck @@ -2,6 +2,7 @@ create or replace package test_package_3 is --%suite --%suitepath(tests2) + --%rollback(auto) gv_glob_val number; diff --git a/tests/ut_expectations/common/ut.expect.to_be_between.scalar.common.sql b/tests/ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql similarity index 57% rename from tests/ut_expectations/common/ut.expect.to_be_between.scalar.common.sql rename to tests/ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql index 09b850813..46e4f4bc3 100644 --- a/tests/ut_expectations/common/ut.expect.to_be_between.scalar.common.sql +++ b/tests/ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql @@ -1,18 +1,17 @@ --Arrange declare l_actual &&1 := &&2; - l_expected_1 &&1 := &&3; - l_expected_2 &&1 := &&4; + l_expected &&1 := &&3; l_result integer; begin --Act - ut.expect(l_actual).to_be_between(l_expected_1,l_expected_2); + ut.expect(l_actual).not_to_equal(l_expected); l_result := ut_expectation_processor.get_status(); --Assert - if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and l_result = &&5 then + if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and l_result = &&4 then :test_result := ut_utils.tr_success; else - dbms_output.put_line('expected: '''||&&5||''', got: '''||l_result||'''' ); + dbms_output.put_line('expected: '''||&&4||''', got: '''||l_result||'''' ); end if; end; / diff --git a/tests/ut_expectations/common/ut.expect.to_be_between.scalar.different_types.common.sql b/tests/ut_expectations/common/ut.expect.to_be_between.scalar.different_types.common.sql deleted file mode 100644 index dcb1e1611..000000000 --- a/tests/ut_expectations/common/ut.expect.to_be_between.scalar.different_types.common.sql +++ /dev/null @@ -1,18 +0,0 @@ ---Arrange -declare - l_actual &&1 := &&3; - l_expected_1 &&2 := &&4; - l_expected_2 &&2 := &&5; - l_result integer; -begin ---Act - ut.expect(l_actual).to_be_between(l_expected_1,l_expected_2); - l_result := ut_expectation_processor.get_status(); ---Assert - if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and l_result = &&6 then - :test_result := ut_utils.tr_success; - else - dbms_output.put_line('expected: '''||&&6||''', got: '''||l_result||'''' ); - end if; -end; -/ diff --git a/tests/ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql b/tests/ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql deleted file mode 100644 index 036380947..000000000 --- a/tests/ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql +++ /dev/null @@ -1,20 +0,0 @@ ---Arrange -declare - l_actual &&1 := &&2; - l_expected_1 &&1 := &&3; - l_expected_2 &&1 := &&4; - l_results ut_expectation_results; - l_test_description varchar2(30) := 'A test message'; -begin ---Act - ut.expect(l_actual, l_test_description).to_be_between(l_expected_1, l_expected_2); - l_results := ut_expectation_processor.get_expectations_results(); - ---Assert - if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and treat(l_results(1) as ut_expectation_result).description like ''||l_test_description||'' then - :test_result := ut_utils.tr_success; - else - dbms_output.put_line('expected: '''||treat(l_results(1) as ut_expectation_result).description||''' to match '''||l_test_description||'''' ); - end if; -end; -/ diff --git a/tests/ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql b/tests/ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql index 3f33a0014..c9b11bdab 100644 --- a/tests/ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql +++ b/tests/ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql @@ -5,7 +5,7 @@ declare l_result integer; begin --Act - ut.expect(l_actual).to_equal(l_expected); + ut.expect(l_actual).&&5.to_equal(l_expected); l_result := ut_expectation_processor.get_status(); --Assert if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and l_result = ut_utils.tr_failure then diff --git a/tests/ut_expectations/ut.expect.not_to_equal.GivesFailureForDifferentDataTypes.sql b/tests/ut_expectations/ut.expect.not_to_equal.GivesFailureForDifferentDataTypes.sql new file mode 100644 index 000000000..1c03460f9 --- /dev/null +++ b/tests/ut_expectations/ut.expect.not_to_equal.GivesFailureForDifferentDataTypes.sql @@ -0,0 +1,17 @@ +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'blob' 'clob' 'to_blob(''ABC'')' '''ABC''' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'blob' '''ABC''' 'to_blob(''ABC'')' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'anydata' '''ABC''' 'null' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'anydata' 'sys_refcursor' 'null' 'null' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'sys_refcursor' 'anydata' 'null' 'null' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'varchar2(4000)' '''Abc''' '''Abc''' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'date' 'timestamp' 'sysdate' 'sysdate' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'date' 'timestamp with local time zone' 'sysdate' 'sysdate' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp' 'date' 'sysdate' 'sysdate' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp with local time zone' 'timestamp' 'sysdate' 'sysdate' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp with local time zone' 'timestamp with time zone' 'sysdate' 'sysdate' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'number' 'varchar2(4000)' '1' '''1''' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'varchar2(4000)' 'number' '''1''' '1' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'varchar2(4000)' 'boolean' '''true''' 'true' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'interval day to second' 'interval year to month' '''2 01:00:00''' '''1-1''' 'not_'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'interval year to month' 'interval day to second' '''1-1''' '''2 01:00:00''' 'not_'" + diff --git a/tests/ut_expectations/ut.expect.not_to_equal.GivesFailureForEqualValues.sql b/tests/ut_expectations/ut.expect.not_to_equal.GivesFailureForEqualValues.sql new file mode 100644 index 000000000..5e9b88162 --- /dev/null +++ b/tests/ut_expectations/ut.expect.not_to_equal.GivesFailureForEqualValues.sql @@ -0,0 +1,15 @@ +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'blob' 'to_blob(''Abc'')' 'to_blob(''abc'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'boolean' 'false' 'false' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'clob' '''Abc''' '''Abc''' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'number' '12345' '12345' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'timestamp(9)' 'to_Timestamp(''2016 123456789'',''yyyy ff'')' 'to_Timestamp(''2016 123456789'',''yyyy ff'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'timestamp(9) with local time zone' 'to_Timestamp(''2016 123456789'',''yyyy ff'')' 'to_Timestamp(''2016 123456789'',''yyyy ff'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'timestamp(9) with time zone' 'to_Timestamp(''2016 123456789'',''yyyy ff'')' 'to_Timestamp(''2016 123456789'',''yyyy ff'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'varchar2(4000)' '''Abc''' '''Abc''' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'interval day to second' '''2 01:00:00''' '''2 01:00:00''' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'interval year to month' '''1-1''' '''1-1''' 'ut_utils.tr_failure'" + + + + diff --git a/tests/ut_expectations/ut.expect.not_to_equal.GivesSuccessForDifferentValues.sql b/tests/ut_expectations/ut.expect.not_to_equal.GivesSuccessForDifferentValues.sql new file mode 100644 index 000000000..0404d0959 --- /dev/null +++ b/tests/ut_expectations/ut.expect.not_to_equal.GivesSuccessForDifferentValues.sql @@ -0,0 +1,11 @@ +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'blob' 'to_blob(''abc'')' 'to_blob(''abd'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'boolean' 'true' 'false' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'clob' '''Abc''' '''abc''' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'number' '0.1' '0.3' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'timestamp' 'systimestamp' 'systimestamp' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'timestamp with time zone' 'systimestamp' 'systimestamp' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'varchar2(4000)' '''Abc''' '''abc''' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'interval day to second' '''2 01:00:00''' '''2 01:00:01''' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql 'interval year to month' '''1-1''' '''1-2''' 'ut_utils.tr_success'" diff --git a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureForDifferentValues.sql b/tests/ut_expectations/ut.expect.to_be_between.GivesFailureForDifferentValues.sql deleted file mode 100644 index 20edb8955..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureForDifferentValues.sql +++ /dev/null @@ -1,5 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'sysdate+2' 'sysdate-1' 'sysdate' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' '0.1' '0.3' '0.5' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'systimestamp' 'systimestamp' 'systimestamp' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp' 'systimestamp' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'systimestamp' 'systimestamp' 'systimestamp' 'ut_utils.tr_failure'" diff --git a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenActualIsNull.sql b/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenActualIsNull.sql deleted file mode 100644 index 40fad1b83..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenActualIsNull.sql +++ /dev/null @@ -1,5 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'NULL' 'sysdate-1' 'sysdate' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' 'NULL' '0' '1' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'NULL' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'NULL' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'NULL' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure'" diff --git a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenBothActualAndExpectedRangeIsNull.sql b/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenBothActualAndExpectedRangeIsNull.sql deleted file mode 100644 index 348450071..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenBothActualAndExpectedRangeIsNull.sql +++ /dev/null @@ -1,6 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'NULL' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' 'NULL' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'NULL' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'NULL' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'NULL' 'NULL' 'NULL' 'ut_utils.tr_failure'" - diff --git a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenExpectedRangeIsNull.sql b/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenExpectedRangeIsNull.sql deleted file mode 100644 index f19a657e4..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.GivesFailureWhenExpectedRangeIsNull.sql +++ /dev/null @@ -1,18 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'sysdate' 'NULL' 'sysdate' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' '1234' 'NULL' '1234' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'systimestamp' 'NULL' 'systimestamp' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'systimestamp' 'NULL' 'systimestamp' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'systimestamp' 'NULL' 'systimestamp' 'ut_utils.tr_failure'" - -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'sysdate' 'sysdate' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' '1234' '1234' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'systimestamp' 'systimestamp' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'systimestamp' 'systimestamp' 'NULL' 'ut_utils.tr_failure'" - -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'sysdate' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' '1234' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'systimestamp' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'systimestamp' 'NULL' 'NULL' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'systimestamp' 'NULL' 'NULL' 'ut_utils.tr_failure'" - diff --git a/tests/ut_expectations/ut.expect.to_be_between.GivesSuccessWhenDifferentTypes.sql b/tests/ut_expectations/ut.expect.to_be_between.GivesSuccessWhenDifferentTypes.sql deleted file mode 100644 index 7884dad5d..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.GivesSuccessWhenDifferentTypes.sql +++ /dev/null @@ -1,2 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.different_types.common.sql 'varchar2(4000)' 'number' '''1''' '0' '2' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.different_types.common.sql 'number' 'varchar2(4000)' '1' '''0''' '''2''' 'ut_utils.tr_success'" diff --git a/tests/ut_expectations/ut.expect.to_be_between.GivesTrueForCorrectValues.sql b/tests/ut_expectations/ut.expect.to_be_between.GivesTrueForCorrectValues.sql deleted file mode 100644 index 8446b68fb..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.GivesTrueForCorrectValues.sql +++ /dev/null @@ -1,6 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'date' 'sysdate' 'sysdate-1' 'sysdate+1' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'number' '0.4' '0.3' '0.5' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'varchar2(50)' '''b''' '''a''' '''c''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp' 'systimestamp' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.common.sql 'timestamp with time zone' 'systimestamp' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_success'" diff --git a/tests/ut_expectations/ut.expect.to_be_between.with_text.GivesTheProvidedTextAsMessage.sql b/tests/ut_expectations/ut.expect.to_be_between.with_text.GivesTheProvidedTextAsMessage.sql deleted file mode 100644 index b554b1709..000000000 --- a/tests/ut_expectations/ut.expect.to_be_between.with_text.GivesTheProvidedTextAsMessage.sql +++ /dev/null @@ -1,5 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql 'date' 'sysdate' 'sysdate-1' 'sysdate+1'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql 'number' '0.4' '0.3' '0.5'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql 'timestamp' 'systimestamp' 'systimestamp-1' 'systimestamp'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp-1' 'systimestamp'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_between.scalar.with_message.common.sql 'timestamp with time zone' 'systimestamp' 'systimestamp-1' 'systimestamp'" diff --git a/tests/ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNotBoolean.sql b/tests/ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNotBoolean.sql new file mode 100644 index 000000000..f23e1b98a --- /dev/null +++ b/tests/ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNotBoolean.sql @@ -0,0 +1,20 @@ +PROMPT Gives a failre when expression evaluates to a boolean true +--Arrange +declare + l_result integer; +begin +--Act + ut.expect( 1 ).to_( be_false() ); + l_result := ut_expectation_processor.get_status(); +--Assert + if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and l_result = ut_utils.tr_failure then + :test_result := ut_utils.tr_success; + else + dbms_output.put_line('expected: '''||ut_utils.tr_failure||''', got: '''||l_result||'''' ); + end if; +end; +/ + + + + diff --git a/tests/ut_expectations/ut.expect.to_be_like.FailsForUnsupportedDatatype.sql b/tests/ut_expectations/ut.expect.to_be_like.FailsForUnsupportedDatatype.sql new file mode 100644 index 000000000..03d75ef93 --- /dev/null +++ b/tests/ut_expectations/ut.expect.to_be_like.FailsForUnsupportedDatatype.sql @@ -0,0 +1,17 @@ +declare + l_actual number := 1234; + l_pattern varchar2(32767) := '1234'; + l_escape_char varchar2(32767) := ''; + l_result integer; +begin +--Act + ut.expect( l_actual ).to_( be_like(l_pattern, l_escape_char) ); + l_result := ut_expectation_processor.get_status(); +--Assert + if l_result = ut_utils.tr_failure then + :test_result := ut_utils.tr_success; + else + dbms_output.put_line('expected: '''||l_actual||''', to be like '''||l_pattern||''' escape'''||l_escape_char||'''' ); + end if; +end; +/ diff --git a/tests/ut_expectations/ut.expect.to_be_like.sql b/tests/ut_expectations/ut.expect.to_be_like.sql deleted file mode 100644 index 3a6205f37..000000000 --- a/tests/ut_expectations/ut.expect.to_be_like.sql +++ /dev/null @@ -1,8 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste__en%' '' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste__en\_K%' '\' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste__en%' '' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste__en\_K%' '\' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste_en%' '' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Stephe\__%' '\' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste_en%' '' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Stephe\__%' '\' 'ut_utils.tr_failure'" diff --git a/tests/ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNotBoolean.sql b/tests/ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNotBoolean.sql new file mode 100644 index 000000000..d94e46b13 --- /dev/null +++ b/tests/ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNotBoolean.sql @@ -0,0 +1,20 @@ +PROMPT Gives a failre when expression evaluates to a boolean false +--Arrange +declare + l_result integer; +begin +--Act + ut.expect( 1 ).to_( be_true() ); + l_result := ut_expectation_processor.get_status(); +--Assert + if nvl(:test_result, ut_utils.tr_success) = ut_utils.tr_success and l_result = ut_utils.tr_failure then + :test_result := ut_utils.tr_success; + else + dbms_output.put_line('expected: '''||ut_utils.tr_failure||''', got: '''||l_result||'''' ); + end if; +end; +/ + + + + diff --git a/tests/ut_expectations/ut.expect.to_equal.GivesFailureForDifferentDataTypes.sql b/tests/ut_expectations/ut.expect.to_equal.GivesFailureForDifferentDataTypes.sql index 819bc53e1..5d45fc67f 100644 --- a/tests/ut_expectations/ut.expect.to_equal.GivesFailureForDifferentDataTypes.sql +++ b/tests/ut_expectations/ut.expect.to_equal.GivesFailureForDifferentDataTypes.sql @@ -1,17 +1,17 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'blob' 'clob' 'to_blob(''ABC'')' '''ABC'''" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'blob' '''ABC''' 'to_blob(''ABC'')'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'anydata' '''ABC''' 'null'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'anydata' 'sys_refcursor' 'null' 'null'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'sys_refcursor' 'anydata' 'null' 'null'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'varchar2(4000)' '''Abc''' '''Abc'''" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'date' 'timestamp' 'sysdate' 'sysdate'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'date' 'timestamp with local time zone' 'sysdate' 'sysdate'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp' 'date' 'sysdate' 'sysdate'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp with local time zone' 'timestamp' 'sysdate' 'sysdate'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp with local time zone' 'timestamp with time zone' 'sysdate' 'sysdate'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'number' 'varchar2(4000)' '1' '''1'''" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'varchar2(4000)' 'number' '''1''' '1'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'varchar2(4000)' 'boolean' '''true''' 'true'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'interval day to second' 'interval year to month' '''2 01:00:00''' '''1-1'''" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'interval year to month' 'interval day to second' '''1-1''' '''2 01:00:00'''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'blob' 'clob' 'to_blob(''ABC'')' '''ABC''' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'blob' '''ABC''' 'to_blob(''ABC'')' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'anydata' '''ABC''' 'null' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'anydata' 'sys_refcursor' 'null' 'null' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'sys_refcursor' 'anydata' 'null' 'null' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'clob' 'varchar2(4000)' '''Abc''' '''Abc''' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'date' 'timestamp' 'sysdate' 'sysdate' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'date' 'timestamp with local time zone' 'sysdate' 'sysdate' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp' 'date' 'sysdate' 'sysdate' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp with local time zone' 'timestamp' 'sysdate' 'sysdate' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'timestamp with local time zone' 'timestamp with time zone' 'sysdate' 'sysdate' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'number' 'varchar2(4000)' '1' '''1''' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'varchar2(4000)' 'number' '''1''' '1' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'varchar2(4000)' 'boolean' '''true''' 'true' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'interval day to second' 'interval year to month' '''2 01:00:00''' '''1-1''' ''" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql 'interval year to month' 'interval day to second' '''1-1''' '''2 01:00:00''' ''" diff --git a/tests/ut_expectations/ut.expect.to_equal.GivesSuccessForEqualValues.sql b/tests/ut_expectations/ut.expect.to_equal.GivesSuccessForEqualValues.sql index 70b0293f0..a5e686625 100644 --- a/tests/ut_expectations/ut.expect.to_equal.GivesSuccessForEqualValues.sql +++ b/tests/ut_expectations/ut.expect.to_equal.GivesSuccessForEqualValues.sql @@ -1,5 +1,5 @@ @@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.scalar.common.sql 'blob' 'to_blob(''Abc'')' 'to_blob(''abc'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.scalar.common.sql 'boolean' 'false' 'false' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.scalar.common.sql 'boolean' 'true' 'true' 'ut_utils.tr_success'" @@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.scalar.common.sql 'clob' '''Abc''' '''Abc''' 'ut_utils.tr_success'" @@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.scalar.common.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_success'" @@lib/RunTest.sql "ut_expectations/common/ut.expect.to_equal.scalar.common.sql 'number' '12345' '12345' 'ut_utils.tr_success'" diff --git a/tests/ut_expectations/ut.expect.to_equal.cursor.ComparesDateAndTimeWhenSetNlsIsUsed.sql b/tests/ut_expectations/ut.expect.to_equal.cursor.ComparesDateAndTimeWhenSetNlsIsUsed.sql index ef525c88a..5ccb3053a 100644 --- a/tests/ut_expectations/ut.expect.to_equal.cursor.ComparesDateAndTimeWhenSetNlsIsUsed.sql +++ b/tests/ut_expectations/ut.expect.to_equal.cursor.ComparesDateAndTimeWhenSetNlsIsUsed.sql @@ -12,7 +12,7 @@ begin open l_expected for select l_date-l_second some_date from dual; ut.reset_nls; - ut.expect(l_actual).not_to( equal(l_expected)); + ut.expect(l_actual).not_to_equal(l_expected); l_result := ut_expectation_processor.get_status(); --Assert diff --git a/tests/ut_expectations/ut.expect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql b/tests/ut_expectations/ut.expect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql index 2d63fcd27..3ef820b9b 100644 --- a/tests/ut_expectations/ut.expect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql +++ b/tests/ut_expectations/ut.expect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql @@ -1,3 +1,4 @@ +set termout off create or replace package ut_equal_sys_refcursor_tests is --%suite(ut_equal on sys_refcursor data) --%suitepath(org.utplsql.test.expectations.equal.refcursor) @@ -84,15 +85,19 @@ create or replace package body ut_equal_sys_refcursor_tests is end; / - +set termout on declare l_result_reporter ut_reporter_base := ut_documentation_reporter(); l_status_reporter ut_reporter_base := utplsql_test_reporter(); begin ut_runner.run(':org.utplsql.test', ut_reporters(l_result_reporter, l_status_reporter)); - ut_output_buffer.lines_to_dbms_output(l_result_reporter.reporter_id); select * into :test_result from table(ut_output_buffer.get_lines(l_status_reporter.reporter_id)); + if :test_result != ut_utils.tr_success then + ut_output_buffer.lines_to_dbms_output(l_result_reporter.reporter_id); + end if; end; / +set termout off drop package ut_equal_sys_refcursor_tests; +set termout on diff --git a/tests/ut_expectations/ut.expect.to_match.FailsForUnsupportedDatatype.sql b/tests/ut_expectations/ut.expect.to_match.FailsForUnsupportedDatatype.sql new file mode 100644 index 000000000..7c50d1d31 --- /dev/null +++ b/tests/ut_expectations/ut.expect.to_match.FailsForUnsupportedDatatype.sql @@ -0,0 +1,17 @@ +declare + l_actual number := 1234; + l_pattern varchar2(32767) := '^1234'; + l_modifiers varchar2(32767) := 'i'; + l_result integer; +begin +--Act + ut.expect( l_actual ).to_( match(l_pattern, l_modifiers) ); + l_result := ut_expectation_processor.get_status(); +--Assert + if l_result = ut_utils.tr_failure then + :test_result := ut_utils.tr_success; + else + dbms_output.put_line('expected: '''||l_actual||''', to match: '''||l_pattern||''' using modifiers:'''||l_modifiers||'''' ); + end if; +end; +/ diff --git a/tests/ut_expectations/ut.expect.to_match.sql b/tests/ut_expectations/ut.expect.to_match.sql deleted file mode 100644 index 8e9b77afe..000000000 --- a/tests/ut_expectations/ut.expect.to_match.sql +++ /dev/null @@ -1,8 +0,0 @@ -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'varchar2(100)' '''Stephen''' '^Ste(v|ph)en$' '' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'varchar2(100)' '''sTEPHEN''' '^Ste(v|ph)en$' 'i' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'clob' 'rpad('' '',32767)||''Stephen''' 'Ste(v|ph)en$' '' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'clob' 'rpad('' '',32767)||''sTEPHEN''' 'Ste(v|ph)en$' 'i' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'varchar2(100)' '''Stephen''' '^Steven$' '' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'varchar2(100)' '''sTEPHEN''' '^Steven$' 'i' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'clob' 'to_clob(rpad('' '',32767)||''Stephen'')' '^Stephen' '' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_expectations/common/ut.expect.to_match.common.sql 'clob' 'to_clob(rpad('' '',32767)||''sTEPHEN'')' '^Stephen' 'i' 'ut_utils.tr_failure'" diff --git a/tests/ut_expectations/ut_expectation_processor.nulls_are_equal.raisesExceptionWhenTryingToSetNullValue.sql b/tests/ut_expectations/ut_expectation_processor.nulls_are_equal.raisesExceptionWhenTryingToSetNullValue.sql index 8456f8ed8..df7342624 100644 --- a/tests/ut_expectations/ut_expectation_processor.nulls_are_equal.raisesExceptionWhenTryingToSetNullValue.sql +++ b/tests/ut_expectations/ut_expectation_processor.nulls_are_equal.raisesExceptionWhenTryingToSetNullValue.sql @@ -1,5 +1,3 @@ -PROMPT raises exception when trying to set null value - declare e_numeric_or_value_error exception; pragma exception_init(e_numeric_or_value_error, -6502); diff --git a/tests/ut_matchers/be_between.sql b/tests/ut_matchers/be_between.sql index f531b8bce..d1d2ff08b 100644 --- a/tests/ut_matchers/be_between.sql +++ b/tests/ut_matchers/be_between.sql @@ -1,11 +1,72 @@ -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'sysdate-2' 'sysdate-1' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' '1.99' '1.999' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''c''' '''a''' '''b''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-2''' '''2-0''' '''2-1''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_failure'" +--failure when value out of range +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'sysdate-2' 'sysdate-1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' '1.99' '1.999' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''c''' '''a''' '''b''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'systimestamp+1' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'systimestamp+1' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'systimestamp+1' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-2''' '''2-0''' '''2-1''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_failure' ''" +--success when value in range +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'sysdate-1' 'sysdate+1' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' '1.99' '2.01' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''b''' '''a''' '''c''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'systimestamp' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'systimestamp' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-1''' '''2-0''' '''2-2''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:58''' '''2 01:00:01''' 'ut_utils.tr_success' ''" +--success when value not in range +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'sysdate-2' 'sysdate-1' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' '1.99' '1.999' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''c''' '''a''' '''b''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'systimestamp+1' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'systimestamp+1' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'systimestamp+1' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-2''' '''2-0''' '''2-1''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_success' 'not_'" +--failure when value not out of range +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'sysdate-1' 'sysdate+1' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' '1.99' '2.01' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''b''' '''a''' '''c''' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'systimestamp' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'systimestamp' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'systimestamp' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-1''' '''2-0''' '''2-2''' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:58''' '''2 01:00:01''' 'ut_utils.tr_failure' 'not_'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'sysdate-1' 'sysdate+1' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' '1.99' '2.01' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''b''' '''a''' '''c''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-1''' '''2-0''' '''2-2''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:58''' '''2 01:00:01''' 'ut_utils.tr_success'" +--failure when value is null +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'null' 'sysdate-1' 'sysdate+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' 'null' '1.99' '2.01' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' 'null' '''a''' '''c''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'null' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'null' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'null' 'systimestamp-1' 'systimestamp+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' 'null' '''2-0''' '''2-2''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' 'null' '''2 00:59:58''' '''2 01:00:01''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'null' 'sysdate-2' 'sysdate-1' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' 'null' '1.99' '1.999' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' 'null' '''a''' '''b''' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'null' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'null' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'null' 'systimestamp-1' 'systimestamp' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' 'null' '''2-0''' '''2-1''' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' 'null' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_failure' 'not_'" + +--failure when lower bound is null +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'null' 'sysdate+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' 'null' '2.01' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''b''' 'null' '''c''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'systimestamp' 'null' 'systimestamp+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'systimestamp' 'null' 'systimestamp+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'systimestamp' 'null' 'systimestamp+1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-1''' 'null' '''2-2''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' 'null' '''2 01:00:01''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'date' 'sysdate' 'null' 'sysdate-1' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'number' '2.0' 'null' '1.999' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'varchar2(1)' '''b''' 'null' '''b''' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp' 'systimestamp+1' 'null' 'systimestamp' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with local time zone' 'systimestamp+1' 'null' 'systimestamp' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'timestamp with time zone' 'systimestamp+1' 'null' 'systimestamp' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval year to month' '''2-2''' 'null' '''2-1''' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_between.sql 'interval day to second' '''2 01:00:00''' 'null' '''2 00:59:59''' 'ut_utils.tr_failure' 'not_'" diff --git a/tests/ut_matchers/be_like.sql b/tests/ut_matchers/be_like.sql new file mode 100644 index 000000000..9989c8c9f --- /dev/null +++ b/tests/ut_matchers/be_like.sql @@ -0,0 +1,19 @@ +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste__en%' '' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste__en\_K%' '\' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste__en%' '' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste__en\_K%' '\' 'ut_utils.tr_success' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste_en%' '' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Stephe\__%' '\' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste_en%' '' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Stephe\__%' '\' 'ut_utils.tr_failure' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste__en%' '' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste__en\_K%' '\' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste__en%' '' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste__en\_K%' '\' 'ut_utils.tr_failure' 'not_'" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Ste_en%' '' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'varchar2(100)' '''Stephen_King''' 'Stephe\__%' '\' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Ste_en%' '' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_be_like.common.sql 'clob' 'rpad(''a'',32767,''a'')||''Stephen_King''' 'a%Stephe\__%' '\' 'ut_utils.tr_success' 'not_'" diff --git a/tests/ut_matchers/common/ut.expect.common.be_between.sql b/tests/ut_matchers/common/ut.expect.common.be_between.sql index acf3d9da1..355895cdf 100644 --- a/tests/ut_matchers/common/ut.expect.common.be_between.sql +++ b/tests/ut_matchers/common/ut.expect.common.be_between.sql @@ -5,7 +5,7 @@ declare l_value_upper &&1 := &&4; begin --Act - ut.expect(l_value1).to_be_between(l_value_lower,l_value_upper); + ut.expect(l_value1).&&6.to_be_between(l_value_lower,l_value_upper); --Assert if ut_expectation_processor.get_status = &&5 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.be_greater_or_equal.sql b/tests/ut_matchers/common/ut.expect.common.be_greater_or_equal.sql index b95b88401..bc77c1817 100644 --- a/tests/ut_matchers/common/ut.expect.common.be_greater_or_equal.sql +++ b/tests/ut_matchers/common/ut.expect.common.be_greater_or_equal.sql @@ -4,7 +4,7 @@ declare l_value2 &&1 := &&3; begin --Act - ut.expect(l_value1).to_(be_greater_or_equal(l_value2)); + ut.expect(l_value1).&&5.to_be_greater_or_equal(l_value2); --Assert if ut_expectation_processor.get_status = &&4 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.be_greater_than.sql b/tests/ut_matchers/common/ut.expect.common.be_greater_than.sql index e4dae22c5..fb4d8d997 100644 --- a/tests/ut_matchers/common/ut.expect.common.be_greater_than.sql +++ b/tests/ut_matchers/common/ut.expect.common.be_greater_than.sql @@ -4,7 +4,7 @@ declare l_value2 &&1 := &&3; begin --Act - ut.expect(l_value1).to_(be_greater_than(l_value2)); + ut.expect(l_value1).&&5.to_be_greater_than(l_value2); --Assert if ut_expectation_processor.get_status = &&4 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.be_less_or_equal.sql b/tests/ut_matchers/common/ut.expect.common.be_less_or_equal.sql index 95ca13af3..b5341ae61 100644 --- a/tests/ut_matchers/common/ut.expect.common.be_less_or_equal.sql +++ b/tests/ut_matchers/common/ut.expect.common.be_less_or_equal.sql @@ -4,7 +4,7 @@ declare l_value2 &&1 := &&3; begin --Act - ut.expect(l_value1).to_(be_less_or_equal(l_value2)); + ut.expect(l_value1).&&5.to_be_less_or_equal(l_value2); --Assert if ut_expectation_processor.get_status = &&4 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.be_less_than.sql b/tests/ut_matchers/common/ut.expect.common.be_less_than.sql index 0f7870d02..5b0fdea20 100644 --- a/tests/ut_matchers/common/ut.expect.common.be_less_than.sql +++ b/tests/ut_matchers/common/ut.expect.common.be_less_than.sql @@ -4,7 +4,7 @@ declare l_value2 &&1 := &&3; begin --Act - ut.expect(l_value1).to_(be_less_than(l_value2)); + ut.expect(l_value1).&&5.to_be_less_than(l_value2); --Assert if ut_expectation_processor.get_status = &&4 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.collection.not_be_empty.sql b/tests/ut_matchers/common/ut.expect.common.collection.not_be_empty.sql index 5449dd800..09900b7a2 100644 --- a/tests/ut_matchers/common/ut.expect.common.collection.not_be_empty.sql +++ b/tests/ut_matchers/common/ut.expect.common.collection.not_be_empty.sql @@ -4,7 +4,7 @@ declare begin --Act l_var := &&2; - ut.expect(anydata.convertcollection(l_var)).not_to(be_empty()); + ut.expect(anydata.convertcollection(l_var)).not_to_be_empty(); --Assert if ut_expectation_processor.get_status = &&3 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.other.not_be_empty.sql b/tests/ut_matchers/common/ut.expect.common.other.not_be_empty.sql index 9e5ce0990..7775fca4e 100644 --- a/tests/ut_matchers/common/ut.expect.common.other.not_be_empty.sql +++ b/tests/ut_matchers/common/ut.expect.common.other.not_be_empty.sql @@ -4,7 +4,7 @@ declare begin --Act l_var := &&2; - ut.expect(anydata.&&3(l_var)).not_to(be_empty()); + ut.expect(anydata.&&3(l_var)).not_to_be_empty(); --Assert if ut_expectation_processor.get_status = &&4 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_matchers/common/ut.expect.common.refcursor.not_to_be_empty.sql b/tests/ut_matchers/common/ut.expect.common.refcursor.not_to_be_empty.sql index c75128135..ff83850c3 100644 --- a/tests/ut_matchers/common/ut.expect.common.refcursor.not_to_be_empty.sql +++ b/tests/ut_matchers/common/ut.expect.common.refcursor.not_to_be_empty.sql @@ -4,7 +4,7 @@ declare begin --Act open l_cursor for &&1; - ut.expect(l_cursor).not_to(be_empty()); + ut.expect(l_cursor).not_to_be_empty(); --Assert if ut_expectation_processor.get_status = &&2 then :test_result := ut_utils.tr_success; diff --git a/tests/ut_expectations/common/ut.expect.to_be_like.common.sql b/tests/ut_matchers/common/ut.expect.to_be_like.common.sql similarity index 86% rename from tests/ut_expectations/common/ut.expect.to_be_like.common.sql rename to tests/ut_matchers/common/ut.expect.to_be_like.common.sql index 1c710329a..b0f825faa 100644 --- a/tests/ut_expectations/common/ut.expect.to_be_like.common.sql +++ b/tests/ut_matchers/common/ut.expect.to_be_like.common.sql @@ -5,7 +5,7 @@ declare l_result integer; begin --Act - ut.expect( l_actual ).to_be_like(l_pattern, l_escape_char); + ut.expect( l_actual ).&&6.to_be_like(l_pattern, l_escape_char); l_result := ut_expectation_processor.get_status(); --Assert if l_result = &5 then diff --git a/tests/ut_expectations/common/ut.expect.to_match.common.sql b/tests/ut_matchers/common/ut.expect.to_match.common.sql similarity index 87% rename from tests/ut_expectations/common/ut.expect.to_match.common.sql rename to tests/ut_matchers/common/ut.expect.to_match.common.sql index 8c5ca3c43..75abfff8f 100644 --- a/tests/ut_expectations/common/ut.expect.to_match.common.sql +++ b/tests/ut_matchers/common/ut.expect.to_match.common.sql @@ -5,7 +5,7 @@ declare l_result integer; begin --Act - ut.expect( l_actual ).to_match(l_pattern, l_modifiers); + ut.expect( l_actual ).&&6.to_match(l_pattern, l_modifiers); l_result := ut_expectation_processor.get_status(); --Assert if l_result = &5 then diff --git a/tests/ut_matchers/greater_or_equal.sql b/tests/ut_matchers/greater_or_equal.sql index bd707cd37..0821fd10a 100644 --- a/tests/ut_matchers/greater_or_equal.sql +++ b/tests/ut_matchers/greater_or_equal.sql @@ -1,23 +1,32 @@ -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '2.0' '1.99' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997-01 09:26:50.13'',''YYYY-MM HH24.MI.SS.FF'')' 'to_timestamp(''1997-01 09:26:50.12'',''YYYY-MM HH24.MI.SS.FF'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '2.0' '1.99' 'ut_utils.tr_success'" "" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997-01 09:26:50.13'',''YYYY-MM HH24.MI.SS.FF'')' 'to_timestamp(''1997-01 09:26:50.12'',''YYYY-MM HH24.MI.SS.FF'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '1.99' '1.99' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''2-0''' '''2-0''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'INTERVAL DAY TO SECOND' '''2 00:59:01''' '''2 00:59:01''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')' 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '1.99' '1.99' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''2-0''' '''2-0''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'INTERVAL DAY TO SECOND' '''2 00:59:01''' '''2 00:59:01''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')' 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate-1' 'sysdate' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '1.0' '1.01' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''2-1''' '''2-2''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')' 'to_timestamp(''1997 09:26:50.13'',''YYYY HH24.MI.SS.FF'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate-2' 'sysdate-1' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '1.0' '1.99' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''1-1''' '''2-0''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval day to second' '''1 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997-01 09:26:50.11'',''YYYY-MM HH24.MI.SS.FF'')' 'to_timestamp(''1997-01 09:26:50.12'',''YYYY-MM HH24.MI.SS.FF'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' 'not_'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'date' 'sysdate-1' 'sysdate' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'number' '1.0' '1.01' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval year to month' '''2-1''' '''2-2''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp' 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')' 'to_timestamp(''1997 09:26:50.13'',''YYYY HH24.MI.SS.FF'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure'" diff --git a/tests/ut_matchers/greater_than.sql b/tests/ut_matchers/greater_than.sql index ec0750b01..f99111a4b 100644 --- a/tests/ut_matchers/greater_than.sql +++ b/tests/ut_matchers/greater_than.sql @@ -1,15 +1,23 @@ -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'number' '2.0' '1.99' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'number' '2.0' '1.99' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'number' '1.0' '1.0' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval year to month' '''2-1''' '''2-1''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:58''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997+02:00'',''YYYY TZR'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'number' '1.0' '1.0' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval year to month' '''2-1''' '''2-1''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:58''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997+02:00'',''YYYY TZR'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'ut_utils.tr_failure' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'date' 'sysdate-1' 'sysdate-1' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'number' '1' '1.99' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval year to month' '''1-1''' '''2-0''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'interval day to second' '''2 01:00:00''' '''2 01:00:00''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 13'',''YYYY FF'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_greater_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success' 'not_'" diff --git a/tests/ut_matchers/less_or_equal.sql b/tests/ut_matchers/less_or_equal.sql index 44921c9c0..53267f4e5 100644 --- a/tests/ut_matchers/less_or_equal.sql +++ b/tests/ut_matchers/less_or_equal.sql @@ -1,23 +1,31 @@ -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '2.0' '1.99' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '2.0' '1.99' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_failure' ''" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '1.99' '1.99' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-0''' '''2-0''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 00:59:01''' '''2 00:59:01''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate' 'sysdate' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '1.99' '1.99' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-0''' '''2-0''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 00:59:01''' '''2 00:59:01''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate-1' 'sysdate' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '1.0' '1.01' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-1''' '''2-2''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 13'',''YYYY FF'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate-1' 'sysdate' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '1.0' '1.01' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-1''' '''2-2''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 13'',''YYYY FF'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'number' '2.0' '1.99' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_or_equal.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')' 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')' 'ut_utils.tr_success' 'not_'" diff --git a/tests/ut_matchers/less_than.sql b/tests/ut_matchers/less_than.sql index ac02b43ac..4fc1c04dc 100644 --- a/tests/ut_matchers/less_than.sql +++ b/tests/ut_matchers/less_than.sql @@ -1,16 +1,25 @@ -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'number' '2.0' '1.99' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_failure'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_failure'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'number' '2.0' '1.99' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_failure' ''" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'date' 'sysdate-1' 'sysdate' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'number' '1.0' '1.01' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval year to month' '''2-1''' '''2-2''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 13'',''YYYY FF'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 12 +03:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_success'" -@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 12 +03:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_success'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'date' 'sysdate-1' 'sysdate' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'number' '1.0' '1.01' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval year to month' '''2-1''' '''2-2''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval day to second' '''2 00:59:58''' '''2 00:59:59''' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp' 'to_timestamp(''1997 12'',''YYYY FF'')' 'to_timestamp(''1997 13'',''YYYY FF'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 12 +03:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 12 +03:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_success' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'date' 'sysdate' 'sysdate-1' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'number' '2.0' '1.99' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval year to month' '''2-1''' '''2-0''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'interval day to second' '''2 01:00:00''' '''2 00:59:59''' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp' 'to_timestamp(''1997 13'',''YYYY FF'')' 'to_timestamp(''1997 12'',''YYYY FF'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with time zone' 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.common.be_less_than.sql 'timestamp with local time zone' 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')' 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')' 'ut_utils.tr_success' 'not_'" + diff --git a/tests/ut_matchers/match.sql b/tests/ut_matchers/match.sql new file mode 100644 index 000000000..e64abe653 --- /dev/null +++ b/tests/ut_matchers/match.sql @@ -0,0 +1,19 @@ +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''Stephen''' '^Ste(v|ph)en$' '' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''sTEPHEN''' '^Ste(v|ph)en$' 'i' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'rpad('' '',32767)||''Stephen''' 'Ste(v|ph)en$' '' 'ut_utils.tr_success' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'rpad('' '',32767)||''sTEPHEN''' 'Ste(v|ph)en$' 'i' 'ut_utils.tr_success' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''Stephen''' '^Steven$' '' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''sTEPHEN''' '^Steven$' 'i' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'to_clob(rpad('' '',32767)||''Stephen'')' '^Stephen' '' 'ut_utils.tr_failure' ''" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'to_clob(rpad('' '',32767)||''sTEPHEN'')' '^Stephen' 'i' 'ut_utils.tr_failure' ''" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''Stephen''' '^Ste(v|ph)en$' '' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''sTEPHEN''' '^Ste(v|ph)en$' 'i' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'rpad('' '',32767)||''Stephen''' 'Ste(v|ph)en$' '' 'ut_utils.tr_failure' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'rpad('' '',32767)||''sTEPHEN''' 'Ste(v|ph)en$' 'i' 'ut_utils.tr_failure' 'not_'" + +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''Stephen''' '^Steven$' '' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'varchar2(100)' '''sTEPHEN''' '^Steven$' 'i' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'to_clob(rpad('' '',32767)||''Stephen'')' '^Stephen' '' 'ut_utils.tr_success' 'not_'" +@@lib/RunTest.sql "ut_matchers/common/ut.expect.to_match.common.sql 'clob' 'to_clob(rpad('' '',32767)||''sTEPHEN'')' '^Stephen' 'i' 'ut_utils.tr_success' 'not_'" diff --git a/tests/ut_suite_manager/ut_suite_manager.CacheInvalidaesOnPackageDrop.sql b/tests/ut_suite_manager/ut_suite_manager.CacheInvalidaesOnPackageDrop.sql index 819bba7e6..63a449f49 100644 --- a/tests/ut_suite_manager/ut_suite_manager.CacheInvalidaesOnPackageDrop.sql +++ b/tests/ut_suite_manager/ut_suite_manager.CacheInvalidaesOnPackageDrop.sql @@ -16,19 +16,22 @@ end; set termout on declare - l_objects_to_run ut_suite_items; - test_result number; + l_test_report ut_varchar2_list; begin - ut.run(USER||'.tst_package_to_be_dropped'); + select * bulk collect into l_test_report from table(ut.run(USER||'.tst_package_to_be_dropped')); end; / +set termout off drop package tst_package_to_be_dropped / +set termout on +declare + l_test_report ut_varchar2_list; begin begin - ut.run(user || '.tst_package_to_be_dropped'); + select * bulk collect into l_test_report from table(ut.run(user || '.tst_package_to_be_dropped')); exception when others then if sqlerrm like '%tst_package_to_be_dropped%does not exist%' then diff --git a/tests/ut_test/ut_test.PackageInInvalidState.sql b/tests/ut_test/ut_test.PackageInInvalidState.sql index 9dbaf5371..661c248df 100644 --- a/tests/ut_test/ut_test.PackageInInvalidState.sql +++ b/tests/ut_test/ut_test.PackageInInvalidState.sql @@ -1,11 +1,11 @@ -PROMPT Reports error when unit test package for a test is in invalid state - +set termout off --Arrange create or replace package invalid_package is v_variable non_existing_type; procedure ut_exampletest; end; / +set termout on declare simple_test ut_test := ut_test(a_object_name => 'invalid_package', a_name => 'ut_exampletest'); @@ -22,5 +22,7 @@ begin end; / +set termout off --Cleanup drop package invalid_package; +set termout off