You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ut.expect( 'supercat', 'checked superhero-animal was not a dog' ).to_( equal('superdog') );
36
+
````
37
+
The message is added to the normal failure message returned by the matcher.
38
+
39
+
This is not only useful to give more detailed and specific information about a test, but also if you have some kind of dynamic tests.
40
+
41
+
### Dynamic tests example
42
+
You have a bunch of tables and an archive-functionality for them and you want to test if the things you put into live-tables are removed from live-tables and present in archive-tables:
Actual: 2 (number) was expected to equal: 1 (number)
82
+
at "UT_TEST_PACKAGE.TEST_DATA_EXISTANCE", line 12 ut.expect( v_count_archive, 'failure checking entry-count of ' || i_tablename || '_archive' ).to_( equal(1) );
83
+
````
84
+
28
85
# Matchers
29
86
utPLSQL provides the following matchers to perform checks on the expected and actual values.
30
87
@@ -471,55 +528,4 @@ end;
471
528
```
472
529
Since NULL is neither *true* nor *not true*, both expectations will report failure.
473
530
474
-
# Provide a custom error message
475
-
Expectations allow you to provide a custom error message as second argument:
476
-
````sql
477
-
ut.expect( a_actual {data-type}, 'custom error message if expectation fails' ).to_{matcher};
478
-
````
479
-
The message is added to the normal error message returned by the matcher.
480
-
481
-
This is not only useful to give more detailed and specific information about a test, but also if you have some kind of dynamic tests.
482
-
483
-
## Dynamic tests example
484
-
You have a bunch of tables and an archive-functionality for them and you want to test if the things you put into live-tables are removed from live-tables and present in archive-tables:
0 commit comments