From 727bf09e7098b2366c8e4c59973644e5d4473897 Mon Sep 17 00:00:00 2001 From: Thijs Cadier Date: Sun, 24 Jan 2021 22:30:55 +0100 Subject: [PATCH] Update use of tests dir --- tests/bson_encode_decode.rs | 5 +++++ tests/bulk_operation.rs | 6 ++++-- tests/client.rs | 4 ++++ tests/collection.rs | 5 ++++- tests/cursor.rs | 7 +++++-- tests/database.rs | 7 ++++++- tests/flags.rs | 2 ++ tests/read_prefs.rs | 2 ++ tests/tests.rs | 15 --------------- tests/uri.rs | 1 + tests/write_concern.rs | 2 ++ 11 files changed, 35 insertions(+), 21 deletions(-) delete mode 100644 tests/tests.rs diff --git a/tests/bson_encode_decode.rs b/tests/bson_encode_decode.rs index 3d0d73a..9c5ecf0 100644 --- a/tests/bson_encode_decode.rs +++ b/tests/bson_encode_decode.rs @@ -1,7 +1,12 @@ +extern crate bson; +extern crate chrono; +extern crate mongo_driver; + use chrono::prelude::*; use mongo_driver::client::{ClientPool,Uri}; +use bson::{bson,doc}; use bson::oid::ObjectId; use bson::spec::BinarySubtype; diff --git a/tests/bulk_operation.rs b/tests/bulk_operation.rs index 7a8c115..f9316b6 100644 --- a/tests/bulk_operation.rs +++ b/tests/bulk_operation.rs @@ -1,7 +1,9 @@ -use std::env; +extern crate bson; +extern crate mongo_driver; -use bson; +use std::env; +use bson::{bson,doc}; use mongo_driver::client::{ClientPool,Uri}; #[test] diff --git a/tests/client.rs b/tests/client.rs index ff9d4ee..0eac0c7 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -1,8 +1,12 @@ +extern crate bson; +extern crate mongo_driver; + use std::env; use std::path::PathBuf; use std::sync::Arc; use std::thread; +use bson::{bson,doc}; use mongo_driver::client::{ClientPool,SslOptions,Uri}; #[test] diff --git a/tests/collection.rs b/tests/collection.rs index e4f6ad7..aa9f28b 100644 --- a/tests/collection.rs +++ b/tests/collection.rs @@ -1,4 +1,7 @@ -use bson; +extern crate bson; +extern crate mongo_driver; + +use bson::{bson,doc}; use mongo_driver::CommandAndFindOptions; use mongo_driver::collection::{CountOptions,FindAndModifyOperation}; diff --git a/tests/cursor.rs b/tests/cursor.rs index f99ddb3..a633df4 100644 --- a/tests/cursor.rs +++ b/tests/cursor.rs @@ -1,8 +1,11 @@ +extern crate bson; +extern crate mongo_driver; + use std::sync::Arc; use std::thread; use std::time::Duration; -use bson; +use bson::{bson,doc}; use mongo_driver::client::{ClientPool,Uri}; use mongo_driver::Result; @@ -133,4 +136,4 @@ fn test_batch_cursor() { } collection.drop().unwrap(); -} \ No newline at end of file +} diff --git a/tests/database.rs b/tests/database.rs index 5acfed4..fb70c9e 100644 --- a/tests/database.rs +++ b/tests/database.rs @@ -1,3 +1,8 @@ +extern crate bson; +extern crate mongo_driver; + +use bson::{bson,doc}; + use mongo_driver::client::{ClientPool,Uri}; #[cfg_attr(target_os = "windows", ignore)] @@ -74,4 +79,4 @@ fn test_has_collection() { assert_eq!(COLL_NAME, collection.get_name().to_mut()); assert!(database.has_collection(COLL_NAME).unwrap()); -} \ No newline at end of file +} diff --git a/tests/flags.rs b/tests/flags.rs index 7dd40f5..d63f0d0 100644 --- a/tests/flags.rs +++ b/tests/flags.rs @@ -1,3 +1,5 @@ +extern crate mongo_driver; + use mongo_driver::flags::*; #[test] diff --git a/tests/read_prefs.rs b/tests/read_prefs.rs index 363eb05..f9cbdcd 100644 --- a/tests/read_prefs.rs +++ b/tests/read_prefs.rs @@ -1,3 +1,5 @@ +extern crate mongo_driver; + use mongo_driver::read_prefs::ReadPrefs; #[test] diff --git a/tests/tests.rs b/tests/tests.rs deleted file mode 100644 index 6f83d62..0000000 --- a/tests/tests.rs +++ /dev/null @@ -1,15 +0,0 @@ -extern crate mongo_driver; -extern crate chrono; -#[macro_use] -extern crate bson; - -mod bson_encode_decode; -mod bulk_operation; -mod client; -mod collection; -mod cursor; -mod database; -mod flags; -mod read_prefs; -mod uri; -mod write_concern; diff --git a/tests/uri.rs b/tests/uri.rs index ab65a9b..ac23632 100644 --- a/tests/uri.rs +++ b/tests/uri.rs @@ -1,3 +1,4 @@ +extern crate mongo_driver; use mongo_driver::client::Uri; #[test] diff --git a/tests/write_concern.rs b/tests/write_concern.rs index 04987b9..6fe45df 100644 --- a/tests/write_concern.rs +++ b/tests/write_concern.rs @@ -1,3 +1,5 @@ +extern crate mongo_driver; + use mongo_driver::write_concern::WriteConcern; #[test]