mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
add ui tests for ipnetwork
This commit is contained in:
parent
9b6e1e089b
commit
fb66cfa665
@ -13,6 +13,10 @@ fn ui_tests() {
|
||||
if cfg!(not(feature = "uuid")) {
|
||||
t.compile_fail("tests/ui/postgres/gated/uuid.rs");
|
||||
}
|
||||
|
||||
if cfg!(not(feature = "ipnetwork")) {
|
||||
t.compile_fail("tests/ui/postgres/gated/ipnetwork.rs");
|
||||
}
|
||||
}
|
||||
|
||||
if cfg!(feature = "mysql") {
|
||||
|
||||
9
tests/ui/postgres/gated/ipnetwork.rs
Normal file
9
tests/ui/postgres/gated/ipnetwork.rs
Normal file
@ -0,0 +1,9 @@
|
||||
fn main() {
|
||||
let _ = sqlx::query!("select '127.0.0.1'::inet");
|
||||
|
||||
let _ = sqlx::query!("select '2001:4f8:3:ba::/64'::cidr");
|
||||
|
||||
let _ = sqlx::query!("select $1::inet", ());
|
||||
|
||||
let _ = sqlx::query!("select $1::cidr", ());
|
||||
}
|
||||
31
tests/ui/postgres/gated/ipnetwork.stderr
Normal file
31
tests/ui/postgres/gated/ipnetwork.stderr
Normal file
@ -0,0 +1,31 @@
|
||||
error: optional feature `ipnetwork` required for type INET of column #1 ("inet")
|
||||
--> $DIR/ipnetwork.rs:2:13
|
||||
|
|
||||
2 | let _ = sqlx::query!("select '127.0.0.1'::inet");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: optional feature `ipnetwork` required for type CIDR of column #1 ("cidr")
|
||||
--> $DIR/ipnetwork.rs:4:13
|
||||
|
|
||||
4 | let _ = sqlx::query!("select '2001:4f8:3:ba::/64'::cidr");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: optional feature `ipnetwork` required for type INET of param #1
|
||||
--> $DIR/ipnetwork.rs:6:13
|
||||
|
|
||||
6 | let _ = sqlx::query!("select $1::inet", ());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: optional feature `ipnetwork` required for type CIDR of param #1
|
||||
--> $DIR/ipnetwork.rs:8:13
|
||||
|
|
||||
8 | let _ = sqlx::query!("select $1::cidr", ());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
Loading…
x
Reference in New Issue
Block a user