8000 Minor typo, style, grammar fixes and clarifications · utPLSQL/utPLSQL@ed8415f · GitHub
[go: up one dir, main page]

Skip to content

Commit ed8415f

Browse files
committed
Minor typo, style, grammar fixes and clarifications
1 parent bb1e9b3 commit ed8415f

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

docs/userguide/expectations.md

Lines changed: 16 additions & 13 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Expectation is a combination of:
2424
- the expected value
2525
- optional custom message for the expectation
2626
- 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
2828

2929

3030
Matcher defines the comparison operation to be performed on expected (and actual) value.
@@ -88,7 +88,7 @@ There are two ways to use expectations:
8888
- without invoking the utPLSQL framework - running expectations standalone
8989

9090
## 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:
9292
- status of each expectation
9393
- outcomes (messages) produced by each expectation
9494
- call stack to each expectation
@@ -161,7 +161,7 @@ When expectations are invoked outside of utPLSQL framework the outputs from expe
161161
> 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.
162162
163163
**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.
165165
166166
**Note:**
167167
> 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
186186
- `match( a_patter {varchar2} [, a_modifiers {varchar2}] )`
187187

188188
## Providing a custom message
189-
You can provide a custom failure message as second argument for the expectation by passing message as the second parameter to the expectation.
189+
You can provide a custom failure message by passing it as the second parameter to the expectation.
190190
`ut.expect( a_actual {data-type}, a_message {varchar2} ).to_{matcher}`
191191

192192
Example:
@@ -312,6 +312,9 @@ FAILURE
312312
```
313313
Since NULL is neither *true* nor *false*, both expectations will report failure.
314314

315+
**Note:**
316+
Beware that `not_to_contain` is not a simple negation of `to_contain`: `not_to_contain` checks whether the actual and the expected set are disjoint.
317+
315318
# Supported data types
316319

317320
The matrix below illustrates the data types supported by different matchers.
@@ -386,7 +389,7 @@ For more details see documentation of the [`--%throws` annotation.](annotations.
386389

387390
# Matchers
388391

389-
You can choose different matchers to validate the your PL/SQL code is working as expected.
392+
You can choose different matchers to validate that your PL/SQL code is working as expected.
390393

391394

392395
## be_between
@@ -759,7 +762,7 @@ FAILURE
759762
## have_count
760763
Unary matcher that validates if the provided dataset count is equal to expected value.
761764
762-
Can be used with `refcursor` , `json`or `table type`
765+
Can be used with `refcursor`, `json` or `table type`
763766
764767
Usage:
765768
```sql
@@ -827,8 +830,8 @@ FAILURE
827830
```
828831
829832
## 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.
833+
The `equal` matcher is very restrictive. Test using this matcher succeeds only when the compared data-types are exactly the same.
834+
If you are comparing a `varchar2` to a `number`, it will fail even if the text contains the same numeric value as the number.
832835
The matcher will also fail when comparing a `timestamp` to a `timestamp with timezone` data-type etc.
833836
834837
The matcher enables detection of data-type changes.
@@ -916,13 +919,13 @@ To change the behavior of `NULL = NULL` comparison pass the `a_nulls_are_equal =
916919
917920
This matcher supports only compound data-types comparison. It check if the actual set contains all values of expected subset.
918921
919-
When comparing data using `contain` matcher, the data-types of columns for compared compound types must be exactly the same.
922+
When comparing data using the `contain` matcher, the data-types of columns for compared compound types must be exactly the same.
920923
921-
The matcher supports all advanced comparison options as `equal` like: `include` , `exclude`, `join_by` etc..
924+
The matcher supports all advanced comparison options supported by `equal` like: `include` , `exclude`, `join_by` etc..
922925
923926
The matcher is successful when actual data set contains all of the values from expected results.
924927
925-
The matcher will cause a test to fail if actual data set does not contain any of expected values.
928+
The matcher will cause a test to fail if actual data set does not contain some of expected values.
926929
927930
![included_set](../images/venn21.gif)
928931
@@ -1108,7 +1111,7 @@ utPLSQL is capable of comparing compound data-types including:
11081111
- 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
11091112
- 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.
11101113
- 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.
1114+
- 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.
11121115
- To compare nested table/varray type you need to convert it to `anydata` by using `anydata.convertCollection()`
11131116
- To compare object type you need to convert it to `anydata` by using `anydata.convertObject()`
11141117
- 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 +1544,7 @@ drop table events;
15411544
15421545
In the above example:
15431546
- 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)
1547+
- The second expectation fails, as the column `event_date` will get compared as DATE without TIME (using default current session NLS date format)
15451548
15461549
Output via DBMS_OUTPUT from the above example:
15471550
```

0 commit comments

Comments
 (0)
0