Test Compile

This commit is contained in:
Daniel Akhterov 2019-08-20 22:32:06 -07:00 committed by Ryan Leckey
parent 0917e84e0f
commit 0aa64f8ebb
13 changed files with 17 additions and 24 deletions

View File

@ -53,7 +53,7 @@ mod test {
use crate::mariadb::{ComStmtFetch, ComStmtPrepareResp, FieldType, ResultSet};
use failure::Error;
#[runtime::test]
#[tokio::test]
async fn it_can_connect() -> Result<(), Error> {
let mut conn = Connection::establish(&"mariadb://root@localhost:3306")
.await?;
@ -61,7 +61,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_can_ping() -> Result<(), Error> {
let mut conn = Connection::establish(&"mariadb://root@localhost:3306")
@ -72,7 +72,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_can_select_db() -> Result<(), Error> {
let mut conn = Connection::establish(&"mariadb://root@localhost:3306")
.await?;
@ -82,7 +82,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_can_query() -> Result<(), Error> {
let mut conn = Connection::establish(&"mariadb://root@localhost:3306")
.await?;
@ -94,7 +94,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_can_prepare() -> Result<(), Error> {
let mut conn = Connection::establish(&"mariadb://root@localhost:3306")
.await?;
@ -107,7 +107,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_can_execute_prepared() -> Result<(), Error> {
let mut conn = Connection::establish(&"mariadb://root@localhost:3306")
.await?;
@ -120,7 +120,7 @@ mod test {
let exec = ComStmtExec {
stmt_id: prepared.ok.stmt_id,
flags: StmtExecFlag::NoCursor,
flags: StmtExecFlag::NO_CURSOR,
params: Some(vec![Some(Bytes::from_static(b"josh"))]),
param_defs: prepared.param_defs,
};
@ -150,7 +150,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_does_not_connect() -> Result<(), Error> {
match Connection::establish(&"mariadb//roote@localhost:3306")
.await

View File

@ -82,7 +82,7 @@ mod tests {
ComStmtExec {
stmt_id: 1,
flags: StmtExecFlag::NoCursor,
flags: StmtExecFlag::NO_CURSOR,
params: Some(vec![Some(Bytes::from_static(b"\x06daniel"))]),
param_defs: Some(vec![ColumnDefPacket {
catalog: Bytes::from_static(b"def"),

View File

@ -41,7 +41,6 @@ mod tests {
use crate::{
__bytes_builder,
mariadb::{ConnContext, DeContext, Decode},
ConnectOptions,
};
use bytes::Bytes;

View File

@ -73,10 +73,9 @@ mod test {
use crate::{
__bytes_builder,
mariadb::{ConnContext, DeContext, Decode},
ConnectOptions,
};
#[runtime::test]
#[tokio::test]
async fn it_decodes_com_stmt_prepare_resp_eof() -> Result<(), failure::Error> {
#[rustfmt::skip]
let buf = __bytes_builder!(
@ -182,7 +181,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_decodes_com_stmt_prepare_resp() -> Result<(), failure::Error> {
#[rustfmt::skip]
let buf = __bytes_builder!(

View File

@ -99,7 +99,7 @@ impl crate::mariadb::Decode for ResultRow {
FieldType::MYSQL_TYPE_JSON => Some(decoder.decode_byte_lenenc()),
FieldType::MYSQL_TYPE_ENUM => Some(decoder.decode_byte_lenenc()),
FieldType::MYSQL_TYPE_SET => Some(decoder.decode_byte_lenenc()),
_ => panic!("Unrecognized FieldType received from MaraiDB"),
_ => panic!("Unrecognized FieldType received from MariaDB"),
}
}
})

View File

@ -40,7 +40,7 @@ mod test {
use super::*;
use crate::{
ConnectOptions, __bytes_builder,
__bytes_builder,
mariadb::{connection::ConnContext, protocol::decode::Decoder},
};

View File

@ -77,7 +77,6 @@ mod test {
use crate::{
__bytes_builder,
mariadb::{ConnContext, Decoder},
ConnectOptions,
};
use bytes::Bytes;

View File

@ -39,7 +39,7 @@ impl Decode for EofPacket {
#[cfg(test)]
mod test {
use super::*;
use crate::{__bytes_builder, mariadb::ConnContext, ConnectOptions};
use crate::{__bytes_builder, mariadb::ConnContext};
use bytes::Bytes;
#[test]

View File

@ -91,8 +91,7 @@ mod test {
use super::*;
use crate::{
__bytes_builder,
mariadb::{ConnContext, Decoder},
ConnectOptions,
mariadb::{ConnContext, Decoder}
};
#[test]

View File

@ -103,7 +103,6 @@ mod test {
use crate::{
__bytes_builder,
mariadb::{ConnContext, Decoder},
ConnectOptions,
};
use bytes::BytesMut;

View File

@ -64,7 +64,6 @@ mod test {
use crate::{
__bytes_builder,
mariadb::{ConnContext, Decoder},
ConnectOptions,
};
#[test]

View File

@ -124,7 +124,7 @@ mod test {
},
};
#[runtime::test]
#[tokio::test]
async fn it_decodes_result_set_text_packet() -> Result<(), Error> {
// TODO: Use byte string as input for test; this is a valid return from a mariadb.
#[rustfmt::skip]
@ -344,7 +344,7 @@ mod test {
Ok(())
}
#[runtime::test]
#[tokio::test]
async fn it_decodes_result_set_binary_packet() -> Result<(), Error> {
// TODO: Use byte string as input for test; this is a valid return from a mariadb.
#[rustfmt::skip]

View File

@ -39,7 +39,6 @@ mod test {
use crate::{
__bytes_builder,
mariadb::{ConnContext, Decoder},
ConnectOptions,
};
use bytes::Bytes;