mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
test: add a test to prove #363 works
This commit is contained in:
parent
b7f8a5fa81
commit
0c80aa4f2c
@ -29,6 +29,20 @@ async fn it_maths() -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[sqlx_macros::test]
|
||||
async fn it_can_fail_at_querying() -> anyhow::Result<()> {
|
||||
let mut conn = new::<MySql>().await?;
|
||||
|
||||
let _ = conn.execute(sqlx::query("SELECT 1")).await?;
|
||||
|
||||
// we are testing that this does not cause a panic!
|
||||
let _ = conn
|
||||
.execute(sqlx::query("SELECT non_existence_table"))
|
||||
.await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[sqlx_macros::test]
|
||||
async fn it_executes() -> anyhow::Result<()> {
|
||||
let mut conn = new::<MySql>().await?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user