From 3fed313193356c6784a33b79d1c2f583ea3944f9 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Wed, 1 Aug 2018 08:08:23 -0700 Subject: Move unit tests into source Move the unit tests into the relevant source files. There's no need for them to be seprate, especially when the `tests` directory is meant to be for integration tests. The deserialization tests that include JSON files are still in the `tests` dir, along with the public prelude re-export tests. --- src/http/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/http') diff --git a/src/http/mod.rs b/src/http/mod.rs index 71c57c6..c50679a 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -2008,3 +2008,21 @@ pub enum GuildPagination { /// The Id to get the guilds before. Before(GuildId), } + +#[cfg(test)] +mod test { + use super::AttachmentType; + use std::path::Path; + + #[test] + fn test_attachment_type() { + assert!(match AttachmentType::from(Path::new("./dogs/corgis/kona.png")) { + AttachmentType::Path(_) => true, + _ => false, + }); + assert!(match AttachmentType::from("./cats/copycat.png") { + AttachmentType::Path(_) => true, + _ => false, + }); + } +} -- cgit v1.2.3