diff --git a/taskchampion/src/lib.rs b/taskchampion/src/lib.rs index cfc127a93..98ed5f8c3 100644 --- a/taskchampion/src/lib.rs +++ b/taskchampion/src/lib.rs @@ -37,6 +37,3 @@ pub use task::{Task, TaskMut}; /// Re-exported type from the `uuid` crate, for ease of compatibility for consumers of this crate. pub use uuid::Uuid; - -#[cfg(test)] -pub(crate) mod testing; diff --git a/taskchampion/src/server/mod.rs b/taskchampion/src/server/mod.rs new file mode 100644 index 000000000..e73c7f74a --- /dev/null +++ b/taskchampion/src/server/mod.rs @@ -0,0 +1,6 @@ +#[cfg(test)] +pub(crate) mod test; + +mod types; + +pub use types::{Blob, Server, VersionAdd}; diff --git a/taskchampion/src/testing/testserver.rs b/taskchampion/src/server/test.rs similarity index 100% rename from taskchampion/src/testing/testserver.rs rename to taskchampion/src/server/test.rs diff --git a/taskchampion/src/server.rs b/taskchampion/src/server/types.rs similarity index 69% rename from taskchampion/src/server.rs rename to taskchampion/src/server/types.rs index 233838fa6..cae8029a8 100644 --- a/taskchampion/src/server.rs +++ b/taskchampion/src/server/types.rs @@ -1,9 +1,12 @@ +/// A Blob is a hunk of encoded data that is sent to the server. The server does not interpret +/// this data at all. pub type Blob = Vec; +/// VersionAdd is the response type from [`crate:server::Server::add_version`]. pub enum VersionAdd { - // OK, version added + /// OK, version added Ok, - // Rejected, must be based on the the given version + /// Rejected, must be based on the the given version ExpectedVersion(u64), } @@ -18,3 +21,4 @@ pub trait Server { fn add_snapshot(&mut self, username: &str, version: u64, blob: Blob); } + diff --git a/taskchampion/src/taskdb.rs b/taskchampion/src/taskdb.rs index f705f3d5a..542ca5cc3 100644 --- a/taskchampion/src/taskdb.rs +++ b/taskchampion/src/taskdb.rs @@ -296,8 +296,8 @@ impl TaskDB { #[cfg(test)] mod tests { use super::*; + use crate::server::test::TestServer; use crate::taskstorage::InMemoryStorage; - use crate::testing::testserver::TestServer; use chrono::Utc; use proptest::prelude::*; use std::collections::HashMap;