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
Copy file name to clipboardExpand all lines: docs/userguide/expectations.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -471,3 +471,55 @@ end;
471
471
```
472
472
Since NULL is neither *true* nor *not true*, both expectations will report failure.
473
473
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