@@ -29,6 +29,12 @@ create or replace package demo_expectations is
2929 -- %test(demo of success for to_be_not_null expectation)
3030 procedure demo_to_be_not_null_success;
3131
32+ -- %test(demo of failure for to_match expectation)
33+ procedure demo_to_match_failure;
34+
35+ -- %test(demo of success for to_match expectation)
36+ procedure demo_to_matchl_success;
37+
3238end;
3339/
3440
@@ -393,5 +399,31 @@ create or replace package body demo_expectations is
393399 ut.expect( l_cursor ).to_( be_not_null );
394400 end;
395401
402+ procedure demo_to_match_failure is
403+ l_clob clob := rpad('a',32767,'a')||'Stephen';
404+ begin
405+ ut.expect( 'STEPHEN' ).to_match('^Stephen$');
406+ ut.expect( 'stephen ' ).to_match('^Stephen$', 'i'); --case insensitive
407+ ut.expect( 'stephen' ).to_( match('^Stephen$') );
408+ ut.expect( 'stephen ' ).to_( match('^Stephen$', 'i') ); --case insensitive
409+ ut.expect( l_clob ).to_match('^Stephen$');
410+ ut.expect( l_clob ).to_match('^Stephen$', 'i'); --case insensitive
411+ ut.expect( l_clob ).to_( match('^Stephen$') );
412+ ut.expect( l_clob ).to_( match('^Stephen$', 'i') ); --case insensitive
413+ end;
414+
415+ procedure demo_to_matchl_success is
416+ l_clob clob := rpad('a',32767,'a')||'STEPHEN';
417+ begin
418+ ut.expect( 'Hi, I am Stephen' ).to_match('Stephen$');
419+ ut.expect( 'stephen' ).to_match('^Stephen$', 'i'); --case insensitive
420+ ut.expect( 'Hi, I am Stephen' ).to_( match('Stephen$') );
421+ ut.expect( 'stephen' ).to_( match('^Stephen$', 'i') ); --case insensitive
422+ ut.expect( l_clob ).to_match('STEPHEN');
423+ ut.expect( l_clob ).to_match('Stephen$', 'i'); --case insensitive
424+ ut.expect( l_clob ).to_( match('STEPHEN$') );
425+ ut.expect( l_clob ).to_( match('Stephen$', 'i') ); --case insensitive
426+ end;
427+
396428end;
397429/
0 commit comments