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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue