aboutsummaryrefslogtreecommitdiff
path: root/src/http
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-08-01 08:08:23 -0700
committerZeyla Hellyer <[email protected]>2018-08-01 08:10:05 -0700
commit3fed313193356c6784a33b79d1c2f583ea3944f9 (patch)
tree875b4bab989fc573850d30317a1797bca5027e9f /src/http
parentReword the inner doc comment in `complex_bucket` (diff)
downloadserenity-3fed313193356c6784a33b79d1c2f583ea3944f9.tar.xz
serenity-3fed313193356c6784a33b79d1c2f583ea3944f9.zip
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.
Diffstat (limited to 'src/http')
-rw-r--r--src/http/mod.rs18
1 files changed, 18 insertions, 0 deletions
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,
+ });
+ }
+}