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
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Expectation is a combination of:
24
24
- the expected value
25
25
- optional custom message for the expectation
26
26
- the matcher used to perform comparison
27
-
-them matcher parameters (actual value), depending on the matcher type
27
+
-the matcher parameters (actual value), depending on the matcher type
28
28
29
29
30
30
Matcher defines the comparison operation to be performed on expected (and actual) value.
@@ -88,7 +88,7 @@ There are two ways to use expectations:
88
88
- without invoking the utPLSQL framework - running expectations standalone
89
89
90
90
## Running expectations within utPLSQL framework
91
-
When expectations are ran a part of test suite, the framework tracks:
91
+
When expectations are ran as a part of a test suite, the framework tracks:
92
92
- status of each expectation
93
93
- outcomes (messages) produced by each expectation
94
94
- call stack to each expectation
@@ -161,7 +161,7 @@ When expectations are invoked outside of utPLSQL framework the outputs from expe
161
161
> Source code of the line which called the expectation is only reported when the line is part of in-database code (package) and the user calling expectation has privileges to see that source code.
162
162
163
163
**Important**
164
-
> Please do not use expectations as part of your production code. They are not designed to be used as part ot your code. Expectations are meant to be used only as part of your day-to-day testing activities.
164
+
> Please do not use expectations as part of your production code. They are not designed to be used as part of your code. Expectations are meant to be used only as part of your day-to-day testing activities.
165
165
166
166
**Note:**
167
167
> The examples in the document will be only using standalone expectations, to keep the document brief.
@@ -186,7 +186,7 @@ utPLSQL provides the following matchers to perform checks on the expected and ac
@@ -386,7 +386,7 @@ For more details see documentation of the [`--%throws` annotation.](annotations.
386
386
387
387
# Matchers
388
388
389
-
You can choose different matchers to validate the your PL/SQL code is working as expected.
389
+
You can choose different matchers to validate that your PL/SQL code is working as expected.
390
390
391
391
392
392
## be_between
@@ -759,7 +759,7 @@ FAILURE
759
759
## have_count
760
760
Unary matcher that validates if the provided dataset count is equal to expected value.
761
761
762
-
Can be used with `refcursor`, `json`or `table type`
762
+
Can be used with `refcursor`, `json`or `table type`
763
763
764
764
Usage:
765
765
```sql
@@ -827,8 +827,8 @@ FAILURE
827
827
```
828
828
829
829
## equal
830
-
The equal matcher is very restrictive. Test using this matcher succeeds only when the compared data-types are exactly the same.
831
-
If you are comparing `varchar2` to a `number` will fail even if the text contains the same numeric value as the number.
830
+
The `equal` matcher is very restrictive. Test using this matcher succeeds only when the compared data-types are exactly the same.
831
+
If you are comparing a `varchar2` to a `number`, it will fail even if the text contains the same numeric value as the number.
832
832
The matcher will also fail when comparing a `timestamp` to a `timestamp with timezone` data-type etc.
833
833
834
834
The matcher enables detection of data-type changes.
@@ -916,13 +916,13 @@ To change the behavior of `NULL = NULL` comparison pass the `a_nulls_are_equal =
916
916
917
917
This matcher supports only compound data-types comparison. It check if the actual set contains all values of expected subset.
918
918
919
-
When comparing data using `contain` matcher, the data-types of columns for compared compound types must be exactly the same.
919
+
When comparing data using the `contain` matcher, the data-types of columns for compared compound types must be exactly the same.
920
920
921
921
The matcher supports all advanced comparison options as `equal` like: `include` , `exclude`, `join_by` etc..
922
922
923
923
The matcher is successful when actual data set contains all of the values from expected results.
924
924
925
-
The matcher will cause a test to fail if actual data set does not contain any of expected values.
925
+
The matcher will cause a test to fail if actual data set does not contain some of expected values.
926
926
927
927

928
928
@@ -1108,7 +1108,7 @@ utPLSQL is capable of comparing compound data-types including:
1108
1108
- Columns in compound data are compared as **ordered list of elements** by default. Use `unordered_columns` option when order of columns in cursor is not relevant
1109
1109
- Comparison of compound data is data-type aware. So a column `ID NUMBER` in a cursor is not the same as `ID VARCHAR2(100)`, even if they both hold the same numeric values.
1110
1110
- Comparison of cursor columns containing `DATE` will only compare date part **and ignore time** by default. See [Comparing cursor data containing DATE fields](#comparing-cursor-data-containing-date-fields) to check how to enable date-time comparison in cursors.
1111
-
- Comparison of cursor returning `TIMESTAMP` **columns** against cursor returning `TIMESTAMP` **bind variables** requires variables to be casted to proper precision. This is an Oracle SQL - PLSQL compatibility issue and usage of CAST is the only known workaround for now. See [Comparing cursor data containing TIMESTAMP bind variables](#comparing-cursor-data-containing-timestamp-bind-variables) for examples.
1111
+
- Comparison of cursor returning `TIMESTAMP` **columns** against cursor returning `TIMESTAMP` **bind variables** requires variables to be cast to proper precision. This is an Oracle SQL - PLSQL compatibility issue and usage of CAST is the only known workaround for now. See [Comparing cursor data containing TIMESTAMP bind variables](#comparing-cursor-data-containing-timestamp-bind-variables) for examples.
1112
1112
- To compare nested table/varray type you need to convert it to `anydata` by using `anydata.convertCollection()`
1113
1113
- To compare object type you need to convert it to `anydata` by using `anydata.convertObject()`
1114
1114
- It is possible to compare PL/SQL records, collections, varrays and associative arrays. To compare this types of data, use cursor comparison feature of utPLSQL and TABLE operator in SQL query
@@ -1541,7 +1541,7 @@ drop table events;
1541
1541
1542
1542
In the above example:
1543
1543
- The first expectation is successful, as the `l_expected` cursor contains different date-time then the cursor returned by `get_events` function call
1544
-
- The second expectation fails, as the column `event_date` will get compared as DATE without TIME (suing default current session NLS date format)
1544
+
- The second expectation fails, as the column `event_date` will get compared as DATE without TIME (using default current session NLS date format)
0 commit comments