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
@@ -26,7 +26,7 @@ All matchers have shortcuts like:
26
26
```
27
27
28
28
# Matchers
29
-
utPLSQL provides following matchers to perform checks on the expected and actual values.
29
+
utPLSQL provides the following matchers to perform checks on the expected and actual values.
30
30
31
31
-`be_between`
32
32
-`be_empty`
@@ -57,7 +57,7 @@ end;
57
57
```
58
58
59
59
## be_empty
60
-
Unary matcher that validates if the provided data-set is empty.
60
+
Unary matcher that validates if the provided dataset is empty.
61
61
62
62
Usage:
63
63
```sql
@@ -86,7 +86,7 @@ end;
86
86
```
87
87
88
88
## be_greater_or_equal
89
-
Allows to check if the actual value is greater or equal than the expected.
89
+
Checks if the actual value is greater or equal than the expected.
90
90
91
91
Usage:
92
92
```sql
@@ -98,7 +98,7 @@ end;
98
98
```
99
99
100
100
## be_greater_than
101
-
Allows to check if the actual value is greater than the expected.
101
+
Checks if the actual value is greater than the expected.
102
102
103
103
Usage:
104
104
```sql
@@ -110,7 +110,7 @@ end;
110
110
```
111
111
112
112
## be_less_or_equal
113
-
Allows to check if the actual value is less or equal than the expected.
113
+
Checks if the actual value is less or equal than the expected.
114
114
115
115
Usage:
116
116
```sql
@@ -122,7 +122,7 @@ end;
122
122
```
123
123
124
124
## be_less_than
125
-
Allows to check if the actual value is less than the expected.
125
+
Checks if the actual value is less than the expected.
126
126
127
127
Usage:
128
128
```sql
@@ -148,7 +148,7 @@ begin
148
148
end;
149
149
```
150
150
151
-
Parameters `a_mask` and `a_escape_char` represent a valid parameters of the [Oracle like function](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142)
151
+
Parameters `a_mask` and `a_escape_char` represent valid parameters of the [Oracle LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142)
152
152
153
153
154
154
## be_not_null
@@ -178,7 +178,7 @@ end;
178
178
```
179
179
180
180
## be_true
181
-
Unary matcher that validates if the provided value is false.
181
+
Unary matcher that validates if the provided value is true.
182
182
-`boolean`
183
183
184
184
Usage:
@@ -192,10 +192,9 @@ end;
192
192
193
193
## equal
194
194
195
-
The equal matcher is a very restrictive matcher. It only returns true, if compared data-types are the same.
196
-
That means, that comparing varchar2 to a number will fail even if the varchar2 contains the same number.
197
-
This matcher is designed to capture changes of data-type, so that if you expect your variable to be number and is now something else,
198
-
the test will fail and give you early indication of potential problem.
195
+
The equal matcher is a very restrictive matcher. It only returns true if the compared data-types are the same.
196
+
That means that comparing varchar2 to a number will fail even if the varchar2 contains the same number.
197
+
This matcher is designed to capture changes of data-type, so that if you expect your variable to be a number and it is now some other type, the test will fail and give you early indication of a potential problem.
The `a_nulls_are_equal` parameter decides on the behavior of `null=null` comparison (**this comparison by default is true!**)
212
+
The `a_nulls_are_equal` parameter controls the behavior of a`null=null` comparison (**this comparison by default is true!**)
214
213
215
214
### Comparing cursors
216
215
217
-
The `equal` matcher accepts additional parameter `a_exclude varchar2` or `a_exclude ut_varchar2_list`, when used to compare `cursor` data.
218
-
Those parameters allow passing a list of column names to exclude from data comparison. The list can be a comma separated `varchar2` list or a `ut_varchar2_list` collection.
219
-
The column names accepted by parameter are **case sensitive** and cannot be quoted.
220
-
If `a_exclude` parameter is not specified, all columns are included.
216
+
The `equal` matcher accepts an additional parameter `a_exclude varchar2` or `a_exclude ut_varchar2_list`, when used to compare `cursor` data.
217
+
218
+
These parameters enable a list of column names to be passed for exclusion from the data comparison. The list can be a comma separated `varchar2` list or a `ut_varchar2_list` collection.
219
+
The column names accepted by the parameter are **case sensitive** and cannot be quoted.
220
+
If the `a_exclude` parameter is not specified, all columns are included.
221
221
If a column to be excluded does not exist, the column cannot be excluded and it's name is simply ignored.
222
-
It is useful when testing cursors containing data that is beyond our control (like default or trigger/procedure generated sysdate values on columns).
222
+
This is useful when testing cursors containing data that is beyond our control (like default or trigger/procedure generated sysdate values on columns).
223
223
224
224
```sql
225
225
procedure test_cursors_skip_columns is
@@ -236,22 +236,22 @@ end;
236
236
237
237
There is a great article by Tim Hall on [using the TABLE Operator with Locally Defined Types in PL/SQL](https://oracle-base.com/articles/12c/using-the-table-operator-with-locally-defined-types-in-plsql-12cr1).
238
238
If you are on Oracle 12c, you can benefit from this feature to make comparison of PLSQL records and tables super-simple in utPLSQL.
239
-
You can use the feature described in article to convert PLSQL records and collection types to cursors. Complex cursor data can then be compared in utPLQL.
239
+
You can use the feature described in the article to convert PLSQL records and collection types to cursors. Complex cursor data can then be compared in utPLQL.
240
240
241
241
242
242
### Comparing cursor data containing DATE fields
243
243
244
244
**Important note**
245
245
246
-
utPLSQL uses XMLType internally to represent rows of the cursor data. This is by far most flexible and allows comparison of cursors containing LONG, CLOB, BLOB, user defined types and even nested cursors.
246
+
utPLSQL uses XMLType internally to represent rows of the cursor data. This is by far the most flexible method and allows comparison of cursors containing LONG, CLOB, BLOB, user defined types and even nested cursors.
247
247
Due to the way Oracle handles DATE data type when converting from cursor data to XML, utPLSQL has no control over the DATE formatting.
248
-
The NLS_DATE_FORMAT setting from the moment the cursor was opened decides ont the formatting of dates used for cursor data comparison.
249
-
By default, Oracle NLS_DATE_FORMAT is timeless, so data of DATE datatype, will be compared ignoring the time part of it.
248
+
The NLS_DATE_FORMAT setting from the moment the cursor was opened determines the formatting of dates used for cursor data comparison.
249
+
By default, Oracle NLS_DATE_FORMAT is timeless, so data of DATE datatype, will be compared ignoring the time component.
250
250
251
251
You should use procedures `ut.set_nls`, `ut.reset_nls` around cursors that you want to compare in your tests.
252
-
This way, the DATE data in cursors will get properly formatted for comparison using date-time format.
252
+
This way, the DATE data in cursors will be properly formatted for comparison using date-time format.
253
253
254
-
The example below makes use of `ut.set_nls`, `ut.reset_nls`, so that date in `l_expected` and `l_actual` is compared using date-time formatting.
254
+
The example below makes use of `ut.set_nls`, `ut.reset_nls`, so that the date in `l_expected` and `l_actual` is compared using date-time formatting.
255
255
```sql
256
256
createtableevents (
257
257
description varchar2(4000),
@@ -323,7 +323,7 @@ drop package test_get_events;
323
323
324
324
### Comparing user defined types and collections
325
325
326
-
The `anydata` data type is used to compare user defined object and collections.
326
+
The `anydata` data type is used to compare user defined objects and collections.
327
327
328
328
Example:
329
329
```sql
@@ -368,7 +368,7 @@ end;
368
368
/
369
369
```
370
370
371
-
This test will fail as the `v_acutal` is not equal `v_expected`.
371
+
This test will fail as `v_actual` is not equal `v_expected`.
372
372
373
373
## match
374
374
Validates that the actual value is matching the expected regular expression.
@@ -384,13 +384,13 @@ begin
384
384
end;
385
385
```
386
386
387
-
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle regexp_like function](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
387
+
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle REGEXP_LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
388
388
389
389
390
390
391
391
# Supported data types
392
392
393
-
Below matrix illustrates the data types supported by different matchers.
393
+
The matrix below illustrates the data types supported by different matchers.
0 commit comments