From f0722f7bad88cc7cd3b2e22700e96ec232f0a321 Mon Sep 17 00:00:00 2001 From: Yoh Deadfall Date: Fri, 6 Sep 2024 19:13:17 +0300 Subject: [PATCH 1/2] Fixed false negatives in tests --- pgrx-tests/src/tests/spi_tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pgrx-tests/src/tests/spi_tests.rs b/pgrx-tests/src/tests/spi_tests.rs index fd8ed2cd2..e8e324358 100644 --- a/pgrx-tests/src/tests/spi_tests.rs +++ b/pgrx-tests/src/tests/spi_tests.rs @@ -244,19 +244,19 @@ mod tests { } #[pg_test] - #[should_panic] + #[should_panic(expected = "PreparedStatementArgumentMismatch { expected: 1, got: 0 }")] fn test_cursor_prepared_statement_panics_none_args() -> Result<(), pgrx::spi::Error> { test_cursor_prepared_statement_panics_impl(None) } #[pg_test] - #[should_panic] + #[should_panic(expected = "PreparedStatementArgumentMismatch { expected: 1, got: 0 }")] fn test_cursor_prepared_statement_panics_less_args() -> Result<(), pgrx::spi::Error> { test_cursor_prepared_statement_panics_impl(Some([].to_vec())) } #[pg_test] - #[should_panic] + #[should_panic(expected = "PreparedStatementArgumentMismatch { expected: 1, got: 2 }")] fn test_cursor_prepared_statement_panics_more_args() -> Result<(), pgrx::spi::Error> { test_cursor_prepared_statement_panics_impl(Some([None, None].to_vec())) } From 4fbe9adb87456b1c8ca9a3efb22506a8ec4483ed Mon Sep 17 00:00:00 2001 From: Yoh Deadfall Date: Fri, 6 Sep 2024 19:14:50 +0300 Subject: [PATCH 2/2] Removed useless allow(deprecated) attribute --- pgrx-tests/src/tests/spi_tests.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pgrx-tests/src/tests/spi_tests.rs b/pgrx-tests/src/tests/spi_tests.rs index e8e324358..23cd16fba 100644 --- a/pgrx-tests/src/tests/spi_tests.rs +++ b/pgrx-tests/src/tests/spi_tests.rs @@ -570,7 +570,6 @@ mod tests { } #[pg_test] - #[allow(deprecated)] fn can_return_borrowed_str() -> Result<(), Box> { let res = Spi::connect(|c| { let mut cursor = c.open_cursor("SELECT 'hello' FROM generate_series(1, 10000)", None);