Re-add test modules
parent
6d5c6ec18d
commit
ba41ae9549
@ -1,37 +1,37 @@
|
||||
use mongo_driver::FlagsValue;
|
||||
use mongo_driver::flags::{Flags,FlagsValue,InsertFlag,RemoveFlag,QueryFlag};
|
||||
|
||||
#[test]
|
||||
pub fn test_insert_flags() {
|
||||
let mut flags = super::Flags::new();
|
||||
let mut flags = Flags::new();
|
||||
assert_eq!(0, flags.flags());
|
||||
|
||||
flags.add(super::InsertFlag::ContinueOnError);
|
||||
flags.add(InsertFlag::ContinueOnError);
|
||||
assert_eq!(1, flags.flags());
|
||||
|
||||
flags.add(super::InsertFlag::NoValidate);
|
||||
flags.add(super::InsertFlag::NoValidate);
|
||||
flags.add(InsertFlag::NoValidate);
|
||||
flags.add(InsertFlag::NoValidate);
|
||||
assert_eq!(31, flags.flags());
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_query_flags() {
|
||||
let mut flags = super::Flags::new();
|
||||
let mut flags = Flags::new();
|
||||
assert_eq!(0, flags.flags());
|
||||
|
||||
flags.add(super::QueryFlag::TailableCursor);
|
||||
flags.add(QueryFlag::TailableCursor);
|
||||
assert_eq!(2, flags.flags());
|
||||
|
||||
flags.add(super::QueryFlag::Partial);
|
||||
flags.add(super::QueryFlag::Partial);
|
||||
flags.add(QueryFlag::Partial);
|
||||
flags.add(QueryFlag::Partial);
|
||||
assert_eq!(130, flags.flags());
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_remove_flags() {
|
||||
let mut flags = super::Flags::new();
|
||||
let mut flags = Flags::new();
|
||||
assert_eq!(0, flags.flags());
|
||||
|
||||
flags.add(super::RemoveFlag::SingleRemove);
|
||||
flags.add(super::RemoveFlag::SingleRemove);
|
||||
flags.add(RemoveFlag::SingleRemove);
|
||||
flags.add(RemoveFlag::SingleRemove);
|
||||
assert_eq!(1, flags.flags());
|
||||
}
|
||||
|
@ -1,15 +1,12 @@
|
||||
use mongo_driver::Uri;
|
||||
use mongo_driver::uri::Uri;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn test_new_uri() {
|
||||
let uri = Uri::new("mongodb://localhost:27017/");
|
||||
#[test]
|
||||
fn test_new_uri() {
|
||||
let uri = Uri::new("mongodb://localhost:27017/").unwrap();
|
||||
assert_eq!("mongodb://localhost:27017/", uri.as_str());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_new_invalid_uri() {
|
||||
#[test]
|
||||
fn test_new_invalid_uri() {
|
||||
assert!(Uri::new("@:/mongo::").is_none());
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
use mongo_driver::WriteConcern;
|
||||
use mongo_driver::write_concern::WriteConcern;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn test_write_concern() {
|
||||
#[test]
|
||||
fn test_write_concern() {
|
||||
let write_concern = WriteConcern::new();
|
||||
assert!(!write_concern.inner().is_null());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue