test: add a test to prove #363 works

This commit is contained in:
Ryan Leckey 2020-06-01 16:58:48 -07:00
parent b7f8a5fa81
commit 0c80aa4f2c

View File

@ -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?;