Skip to content

Commit 1c5387c

Browse files
committed
test: geo array test support
1 parent d16c98e commit 1c5387c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sqlx-test/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ macro_rules! test_type {
5151
}
5252
};
5353

54+
($name:ident<$ty:ty>($db:ident, $($text:literal @= $value:expr),+ $(,)?)) => {
55+
paste::item! {
56+
$crate::__test_prepared_type!($name<$ty>($db, $crate::[< $db _query_for_test_prepared_geometric_type >]!(), $($text == $value),+));
57+
}
58+
};
59+
5460
($name:ident($db:ident, $($text:literal == $value:expr),+ $(,)?)) => {
5561
$crate::test_type!($name<$name>($db, $($text == $value),+));
5662
};
@@ -82,6 +88,7 @@ macro_rules! test_prepared_type {
8288
}
8389
};
8490

91+
8592
($name:ident($db:ident, $($text:literal == $value:expr),+ $(,)?)) => {
8693
$crate::__test_prepared_type!($name<$name>($db, $($text == $value),+));
8794
};
@@ -223,3 +230,10 @@ macro_rules! Postgres_query_for_test_prepared_type {
223230
"SELECT ({0} is not distinct from $1)::int4, {0}, $2"
224231
};
225232
}
233+
234+
#[macro_export]
235+
macro_rules! Postgres_query_for_test_prepared_geometric_type {
236+
() => {
237+
"SELECT ({0}::text is not distinct from $1::text)::int4, {0}, $2"
238+
};
239+
}

0 commit comments

Comments
 (0)