message: query_opt test
diff: @@ -691,3 +691,36 @@ async fn query_one() {
  .err()
  .unwrap();
  }
  +
  +#[tokio::test]
  +async fn query_opt() {
  + let client = connect("user=postgres").await;
  +
  + client
  + .batch_execute(
  + "
  + CREATE TEMPORARY TABLE foo (
  + name TEXT
  + );
  + INSERT INTO foo (name) VALUES ('alice'), ('bob'), ('carol');
  + ",
  + )
  + .await
  + .unwrap();
  +
  + assert!(client
  + .query_opt("SELECT * FROM foo WHERE name = 'dave'", &[])
  + .await
  + .unwrap()
  + .is_none());
  + client
  + .query_opt("SELECT * FROM foo WHERE name = 'alice'", &[])
  + .await
  + .unwrap()
  + .unwrap();
  + client
  + .query_one("SELECT * FROM foo", &[])
  + .await
  + .err()
  + .unwrap();
  +}
  