Commit 076988c
authored
Type roundtrip tests (#1185)
A new set of tests to simply check that we can "roundtrip" a Datum. That is, we return the same value as we were given in a `#[pg_extern]` function argument.
Essentially this tests that the type's `FromDatum` and `IntoDatum` impls match, and in the case of arrays, tests that the iterator impl for `Array<T>` works for its individual datums.
In doing so, this uncovered a bug with converting a `pg_sys::Point` (and `pg_sys::BOX`) into a Datum, so those are fixed in here as well.
The addition of `#[derive(Copy)]` to the "Complex" type in pgrx-tests is just to make it work well with the roundtrip tests here.1 parent 8ec818f commit 076988c
File tree
4 files changed
+441
-10
lines changed- pgrx-tests/src/tests
- pgrx/src/datum
4 files changed
+441
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
0 commit comments