Skip to content

Commit d116234

Browse files
committed
added not_to_equal
1 parent a6699b6 commit d116234

34 files changed

+207
-9
lines changed

examples/award_bonus/test_award_bonus.pkg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ create or replace package body test_award_bonus as
5858
procedure fail_on_null_bonus is
5959
begin
6060
award_bonus(emp_id => gc_test_employee, sales_amt => null);
61-
ut.expect( sqlcode ).not_to( equal( 0 ) );
61+
ut.expect( sqlcode ).not_to_equal( 0 );
6262
exception
6363
when others then
64-
ut.expect( sqlcode ).not_to( equal( 0 ) );
64+
ut.expect( sqlcode ).not_to_equal( 0 );
6565
end;
6666

6767
procedure add_employee( emp_id number, comm_pct number, sal number ) is

examples/demo_expectations.pck

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,12 @@ create or replace package body demo_expectations is
546546
ut.expect(sysdate).not_to( be_between(sysdate+1,sysdate+2) );
547547
ut.expect( 1 ).not_to( equal( 2 ) );
548548
ut.expect( 'asd' ).not_to( be_like('z%q') );
549+
550+
ut.expect( sysdate ).not_to_be_null();
551+
ut.expect( to_char(null) ).not_to_be_not_null();
552+
ut.expect(sysdate).not_to_be_between(sysdate+1,sysdate+2);
553+
ut.expect( 1 ).not_to_equal( 2 );
554+
ut.expect( 'asd' ).not_to_be_like('z%q');
549555
end;
550556

551557
end;

source/expectations/ut_expectation.tpb

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,90 @@ create or replace type body ut_expectation as
136136
ut_utils.debug_log('ut_expectation.to_be_not_null');
137137
self.to_( ut_be_not_null() );
138138
end;
139+
140+
member procedure not_to_equal(self in ut_expectation, a_expected anydata, a_nulls_are_equal boolean := null) is
141+
begin
142+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected anydata, a_nulls_are_equal boolean := null)');
143+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
144+
end;
145+
146+
member procedure not_to_equal(self in ut_expectation, a_expected blob, a_nulls_are_equal boolean := null) is
147+
begin
148+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected blob, a_nulls_are_equal boolean := null)');
149+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
150+
end;
151+
152+
member procedure not_to_equal(self in ut_expectation, a_expected boolean, a_nulls_are_equal boolean := null) is
153+
begin
154+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected boolean, a_nulls_are_equal boolean := null)');
155+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
156+
end;
157+
158+
member procedure not_to_equal(self in ut_expectation, a_expected clob, a_nulls_are_equal boolean := null) is
159+
begin
160+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected clob, a_nulls_are_equal boolean := null)');
161+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
162+
end;
163+
164+
member procedure not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null) is
165+
begin
166+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null)');
167+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
168+
end;
169+
170+
member procedure not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null) is
171+
begin
172+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null)');
173+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
174+
end;
175+
176+
member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null) is
177+
begin
178+
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)');
179+
self.not_to( ut_equal(a_expected, a_exclude, a_nulls_are_equal) );
180+
end;
181+
182+
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
183+
begin
184+
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)');
185+
self.not_to( ut_equal(a_expected, a_exclude, a_nulls_are_equal) );
186+
end;
187+
188+
member procedure not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null) is
189+
begin
190+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null)');
191+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
192+
end;
193+
194+
member procedure not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null) is
195+
begin
196+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null)');
197+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
198+
end;
199+
200+
member procedure not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null) is
201+
begin
202+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null)');
203+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
204+
end;
205+
206+
member procedure not_to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null) is
207+
begin
208+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null)');
209+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
210+
end;
211+
212+
member procedure not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null) is
213+
begin
214+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null)');
215+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
216+
end;
217+
218+
member procedure not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null) is
219+
begin
220+
ut_utils.debug_log('ut_expectation.not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null)');
221+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
222+
end;
139223

140224
end;
141225
/

source/expectations/ut_expectation.tps

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,22 @@ create or replace type ut_expectation authid current_user as object(
3636
member procedure to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null),
3737
member procedure to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null),
3838
member procedure to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null),
39-
member procedure to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null)
39+
member procedure to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null),
40+
41+
member procedure not_to_equal(self in ut_expectation, a_expected anydata, a_nulls_are_equal boolean := null),
42+
member procedure not_to_equal(self in ut_expectation, a_expected blob, a_nulls_are_equal boolean := null),
43+
member procedure not_to_equal(self in ut_expectation, a_expected boolean, a_nulls_are_equal boolean := null),
44+
member procedure not_to_equal(self in ut_expectation, a_expected clob, a_nulls_are_equal boolean := null),
45+
member procedure not_to_equal(self in ut_expectation, a_expected date, a_nulls_are_equal boolean := null),
46+
member procedure not_to_equal(self in ut_expectation, a_expected number, a_nulls_are_equal boolean := null),
47+
member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude varchar2 := null, a_nulls_are_equal boolean := null),
48+
member procedure not_to_equal(self in ut_expectation, a_expected sys_refcursor, a_exclude ut_varchar2_list, a_nulls_are_equal boolean := null),
49+
member procedure not_to_equal(self in ut_expectation, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null),
50+
member procedure not_to_equal(self in ut_expectation, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null),
51+
member procedure not_to_equal(self in ut_expectation, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null),
52+
member procedure not_to_equal(self in ut_expectation, a_expected varchar2, a_nulls_are_equal boolean := null),
53+
member procedure not_to_equal(self in ut_expectation, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null),
54+
member procedure not_to_equal(self in ut_expectation, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null)
4055
)
4156
not final not instantiable
4257
/

source/expectations/ut_expectation_anydata.tpb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ create or replace type body ut_expectation_anydata as
2727
self.to_( ut_be_empty() );
2828
end;
2929

30+
overriding member procedure not_to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null) is
31+
begin
32+
ut_utils.debug_log('ut_expectation_anydata.not_to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null)');
33+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
34+
end;
35+
3036
member procedure not_to_be_empty(self in ut_expectation_anydata) is
3137
begin
3238
ut_utils.debug_log('ut_expectation_anydata.not_to_be_empty(self in ut_expectation_anydata)');

source/expectations/ut_expectation_anydata.tps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ create or replace type ut_expectation_anydata under ut_expectation(
1818
overriding member procedure to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null),
1919
member procedure to_be_empty(self in ut_expectation_anydata),
2020

21+
overriding member procedure not_to_equal(self in ut_expectation_anydata, a_expected anydata, a_nulls_are_equal boolean := null),
2122
member procedure not_to_be_empty(self in ut_expectation_anydata)
2223
)
2324
/

source/expectations/ut_expectation_blob.tpb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ create or replace type body ut_expectation_blob as
2020
ut_utils.debug_log('ut_expectation_blob.to_equal(self in ut_expectation, a_expected blob)');
2121
self.to_( ut_equal(a_expected, a_nulls_are_equal) );
2222
end;
23+
24+
overriding member procedure not_to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null) is
25+
begin
26+
ut_utils.debug_log('ut_expectation_blob.not_to_equal(self in ut_expectation, a_expected blob)');
27+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
28+
end;
2329

2430
end;
2531
/

source/expectations/ut_expectation_blob.tps

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ create or replace type ut_expectation_blob under ut_expectation(
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
18-
overriding member procedure to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null)
18+
overriding member procedure to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null),
19+
overriding member procedure not_to_equal(self in ut_expectation_blob, a_expected blob, a_nulls_are_equal boolean := null)
1920
)
2021
/

source/expectations/ut_expectation_boolean.tpb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ create or replace type body ut_expectation_boolean as
3232
ut_utils.debug_log('ut_expectation_boolean.to_be_false(self in ut_expectation_boolean)');
3333
self.to_( ut_be_false() );
3434
end;
35+
36+
overriding member procedure not_to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null) is
37+
begin
38+
ut_utils.debug_log('ut_expectation_boolean.not_to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null)');
39+
self.not_to( ut_equal(a_expected, a_nulls_are_equal) );
40+
end;
3541

3642
end;
3743
/

source/expectations/ut_expectation_boolean.tps

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ create or replace type ut_expectation_boolean under ut_expectation(
1717
*/
1818
overriding member procedure to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null),
1919
member procedure to_be_true(self in ut_expectation_boolean),
20-
member procedure to_be_false(self in ut_expectation_boolean)
20+
member procedure to_be_false(self in ut_expectation_boolean),
21+
22+
overriding member procedure not_to_equal(self in ut_expectation_boolean, a_expected boolean, a_nulls_are_equal boolean := null)
2123
)
2224
/

0 commit comments

Comments
 (0)