Skip to content

Commit

Permalink
chore: fix doc tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ana Hobden <[email protected]>
  • Loading branch information
Hoverbear committed Sep 8, 2021
1 parent a7048c3 commit b431df0
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions pgx/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ macro_rules! log {
/// Given some function:
///
/// ```rust,no_run
/// use pgx::*;
///
/// #[pg_extern]
/// fn sum_array(input: Array<i32>) -> i64 {
/// let mut sum = 0 as i64;
Expand All @@ -632,7 +634,7 @@ macro_rules! log {
///
/// When run inside PostgreSQL would output:
///
/// ```
/// ```sql
/// arrays=# SELECT arrays.sum_array('{1,2,3}');
/// INFO: i=Some(1), sum=0
/// INFO: i=Some(2), sum=1
Expand All @@ -657,6 +659,8 @@ macro_rules! info {
/// Given some function:
///
/// ```rust,no_run
/// use pgx::*;
///
/// #[pg_extern]
/// fn sum_array(input: Array<i32>) -> i64 {
/// let mut sum = 0 as i64;
Expand All @@ -672,7 +676,7 @@ macro_rules! info {
///
/// When run inside PostgreSQL would output:
///
/// ```
/// ```sql
/// arrays=# SELECT arrays.sum_array('{1,2,3}');
/// NOTICE: i=Some(1), sum=0
/// NOTICE: i=Some(2), sum=1
Expand All @@ -697,6 +701,8 @@ macro_rules! notice {
/// Given some function:
///
/// ```rust,no_run
/// use pgx::*;
///
/// #[pg_extern]
/// fn sum_array(input: Array<i32>) -> i64 {
/// let mut sum = 0 as i64;
Expand All @@ -712,7 +718,7 @@ macro_rules! notice {
///
/// When run inside PostgreSQL would output:
///
/// ```
/// ```sql
/// arrays=# SELECT arrays.sum_array('{1,2,3}');
/// WARNING: i=Some(1), sum=0
/// WARNING: i=Some(2), sum=1
Expand All @@ -737,6 +743,8 @@ macro_rules! warning {
/// Given some function:
///
/// ```rust,no_run
/// use pgx::*;
///
/// #[pg_extern]
/// fn sum_array(input: Array<i32>) -> i64 {
/// let mut sum = 0 as i64;
Expand All @@ -752,7 +760,7 @@ macro_rules! warning {
///
/// When run inside PostgreSQL would output:
///
/// ```
/// ```sql
/// arrays=# SELECT arrays.sum_array('{1,2,3}');
/// ERROR: i=Some(1), sum=0
/// CONTEXT: src/lib.rs:37:9
Expand All @@ -775,6 +783,8 @@ macro_rules! error {
/// Given some function:
///
/// ```rust,no_run
/// use pgx::*;
///
/// #[pg_extern]
/// fn sum_array(input: Array<i32>) -> i64 {
/// let mut sum = 0 as i64;
Expand All @@ -790,7 +800,7 @@ macro_rules! error {
///
/// When run inside PostgreSQL would output:
///
/// ```
/// ```sql
/// arrays=# SELECT arrays.sum_array('{1,2,3}');
/// FATAL: i=Some(1), sum=0
/// server closed the connection unexpectedly
Expand All @@ -814,6 +824,8 @@ macro_rules! FATAL {
/// Given some function:
///
/// ```rust,no_run
/// use pgx::*;
///
/// #[pg_extern]
/// fn sum_array(input: Array<i32>) -> i64 {
/// let mut sum = 0 as i64;
Expand All @@ -829,7 +841,7 @@ macro_rules! FATAL {
///
/// When run inside PostgreSQL would output:
///
/// ```
/// ```sql
/// arrays=# SELECT arrays.sum_array('{1,2,3}');
/// PANIC: i=Some(1), sum=0
/// server closed the connection unexpectedly
Expand Down

0 comments on commit b431df0

Please sign in to comment.