You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mongo-rust-driver/tests/flags.rs

48 lines
1.0 KiB
Rust

use mongo_driver::flags::*;
#[test]
fn test_insert_flags() {
let mut flags = Flags::new();
assert_eq!(0, flags.flags());
flags.add(InsertFlag::ContinueOnError);
assert_eq!(1, flags.flags());
flags.add(InsertFlag::NoValidate);
flags.add(InsertFlag::NoValidate);
assert_eq!(31, flags.flags());
}
#[test]
fn test_query_flags() {
let mut flags = Flags::new();
assert_eq!(0, flags.flags());
flags.add(QueryFlag::TailableCursor);
assert_eq!(2, flags.flags());
flags.add(QueryFlag::Partial);
flags.add(QueryFlag::Partial);
assert_eq!(130, flags.flags());
}
#[test]
fn test_remove_flags() {
let mut flags = Flags::new();
assert_eq!(0, flags.flags());
flags.add(RemoveFlag::SingleRemove);
flags.add(RemoveFlag::SingleRemove);
assert_eq!(1, flags.flags());
}
#[test]
fn test_update_flags() {
let mut flags = Flags::new();
assert_eq!(0, flags.flags());
flags.add(UpdateFlag::Upsert);
flags.add(UpdateFlag::MultiUpdate);
assert_eq!(3, flags.flags());
}