@@ -41,6 +41,12 @@ create or replace package demo_expectations is
4141 -- %test(demo of success for to_be_like expectation)
4242 procedure demo_to_be_like_success;
4343
44+ -- %test(demo of failure for not_to expectations)
45+ procedure demo_not_to_failure;
46+
47+ -- %test(demo of success for not_to expectations)
48+ procedure demo_not_to_success;
49+
4450end;
4551/
4652
@@ -469,5 +475,32 @@ create or replace package body demo_expectations is
469475 ut.expect( l_clob ).to_( be_like('a%a_TE%\_', '\') ); --escape wildcards with '\'
470476 end;
471477
478+ procedure demo_not_to_failure is
479+ begin
480+ ut.expect( 'Hi, I am Stephen' ).not_to( be_like('%Stephen') );
481+ ut.expect( 'stephen' ).not_to( match('^Stephen$', 'i') ); --case insensitive
482+ ut.expect( sysdate ).not_to( be_not_null() );
483+ ut.expect( to_char(null) ).not_to( be_null() );
484+ ut.expect( false ).not_to( be_false );
485+ ut.expect( true ).not_to( be_true );
486+ ut.expect( 123 ).not_to( be_false );
487+ ut.expect( sysdate ).not_to( be_true );
488+ ut.expect( 1 ).not_to( equal( 1 ) );
489+ ut.expect( 1 ).not_to( equal( '1' ) );
490+ ut.expect( to_char(null) ).not_to( equal( to_char(null) ) );
491+ end;
492+
493+ procedure demo_not_to_success is
494+ begin
495+ ut.expect( sysdate ).not_to( be_null() );
496+ ut.expect( to_char(null) ).not_to( be_not_null() );
497+ ut.expect( true ).not_to( be_false );
498+ ut.expect( false ).not_to( be_true );
499+ ut.expect( cast(null as boolean) ).not_to( be_false );
500+ ut.expect( cast(null as boolean) ).not_to( be_true );
501+ ut.expect( 1 ).not_to( equal( 2 ) );
502+ ut.expect( to_char(null) ).not_to( equal( to_char(null), a_nulls_are_equal=> false ) );
503+ end;
504+
472505end;
473506/
0 commit comments