Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edc82cc

Browse files
committed
Fixed misleading naming in documentation
Reworded `collection` to `nested table/varray` for schema level table-types
1 parent 812e0ce commit edc82cc

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

docs/userguide/expectations.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ end;
165165
## be_empty
166166
Unary matcher that validates if the provided dataset is empty.
167167

168-
Can be used with `refcursor` or `table type`
168+
Can be used with `refcursor` or `nested table`/`varray` passed as `ANYDATA`
169169

170170
Usage:
171171
```sql
@@ -179,7 +179,16 @@ begin
179179
end;
180180
```
181181

182-
When used with anydata, it is only valid for collection data types.
182+
```sql
183+
procedure test_if_cursor_is_empty is
184+
l_data ut_varchar2_list;
185+
begin
186+
l_data := ut_varchar2_list();
187+
ut.expect( anydata.convertCollection( l_data ) ).to_be_empty();
188+
--or
189+
ut.expect( anydata.convertCollection( l_data ) ).to_( be_empty() );
190+
end;
191+
```
183192

184193
## be_false
185194
Unary matcher that validates if the provided value is false.
@@ -420,7 +429,7 @@ The `a_nulls_are_equal` parameter controls the behavior of a `null = null` compa
420429
To change the behavior of `NULL = NULL` comparison pass the `a_nulls_are_equal => false` to the `equal` matcher.
421430

422431

423-
## Comparing objects, cursors, collections of data
432+
## Comparing cursors, object types, nested tables and varrays
424433

425434
utPLSQL is capable of comparing compound data-types including:
426435
- ref cursors
@@ -434,7 +443,7 @@ utPLSQL is capable of comparing compound data-types including:
434443
- 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.
435444
- To compare nested table/varray type you need to convert it to `anydata` by using `anydata.convertCollection()`
436445
- To compare object type you need to convert it to `anydata` by using `anydata.convertObject()`
437-
- It is possible to compare PL/SQL records and nested tables/varrays/associative arrays of PL/SQL records. To compare this types of data, use cursor comparison feature of utPLSQL and TABLE operator in SQL query
446+
- 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
438447
- On Oracle 11g Release 2 - pipelined table functions are needed (see section [Implicit (Shadow) Types in this artcile](https://oracle-base.com/articles/misc/pipelined-table-functions))
439448
- On Oracle 12c and above - use [TABLE function on nested tables/varrays/associative arrays of PL/SQL records](https://oracle-base.com/articles/12c/using-the-table-operator-with-locally-defined-types-in-plsql-12cr1)
440449

@@ -568,16 +577,16 @@ When comparing rows utPLSQL:
568577
- reports whole missing (expected) row from expected when expected has extra rows
569578

570579

571-
### Object and collection data-type comparison examples
580+
### Object and nested table data-type comparison examples
572581

573-
When comparing object type to object type or collection to collection, utPLSQL will check:
582+
When comparing object type / nested table / varray, utPLSQL will check:
574583
- if data-types match
575-
- if data in the compared objects/collections are the same.
584+
- if data in the compared elements is the same.
576585

577-
The diff functionality for objects and collections is similar to diff on cursors.
578-
When diffing objects/collections however, utPLSQL will not check attribute names and data-types.
586+
The diff functionality for objects / nested tables / varrays is similar to diff on cursors.
587+
When diffing, utPLSQL will not check name and data-type of individual attribute as the type itself defines the underlying structure.
579588

580-
Below examples demonstrate how to compare object and collection data-types.
589+
Below examples demonstrate how to compare object and nested table data-types.
581590

582591
Object type comparison.
583592
```sql
@@ -773,19 +782,21 @@ The matrix below illustrates the data types supported by different matchers.
773782

774783
| | be_between | be_empty | be_false | be_greater_than | be_greater_or_equal | be_less_or_equal | be_less_than | be_like | be_not_null | be_null | be_true | equal | have_count | match |
775784
|:------------------------------|:----------:|:--------:|:--------:|:---------------:|:-------------------:|:----------------:|:------------:|:-------:|:-----------:|:-------:|:-------:|:-----:|:----------:|:-----:|
776-
| anydata( collection, object ) | | X | | | | | | | X | X | | X | X | |
777785
| blob | | | | | | | | | X | X | | X | | |
778786
| boolean | | | X | | | | | | X | X | X | X | | |
779787
| clob | | | | | | | | X | X | X | | X | | X |
780788
| date | X | | | X | X | X | X | | X | X | | X | | |
781789
| number | X | | | X | X | X | X | | X | X | | X | | |
782-
| refcursor | | X | | | | | | | X | X | | X | X | |
783790
| timestamp | X | | | X | X | X | X | | X | X | | X | | |
784791
| timestamp with timezone | X | | | X | X | X | X | | X | X | | X | | |
785792
| timestamp with local timezone | X | | | X | X | X | X | | X | X | | X | | |
786793
| varchar2 | X | | | | | | | X | X | X | | X | | X |
787794
| interval year to month | X | | | X | X | X | X | | X | X | | X | | |
788795
| interval day to second | X | | | X | X | X | X | | X | X | | X | | |
796+
| refcursor | | X | | | | | | | X | X | | X | X | |
797+
| nested table (as anydata) | | X | | | | | | | X | X | | X | X | |
798+
| varray (as anydata) | | X | | | | | | | X | X | | X | X | |
799+
| object (as anydata) | | | | | | | | | X | X | | X | | |
789800

790801

791802

0 commit comments

Comments
 (0)