From 6461a00ba37ab29770637e172303be83a282ecaa Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Fri, 31 Jan 2020 04:21:55 -0800 Subject: [PATCH] Test that `wss://` trackers are accepted type: testing --- src/torrent/create.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/torrent/create.rs b/src/torrent/create.rs index 909b8b1..91d5bce 100644 --- a/src/torrent/create.rs +++ b/src/torrent/create.rs @@ -287,6 +287,18 @@ mod tests { assert!(metainfo.announce_list.is_none()); } + #[test] + fn announce_wss_tracker() { + let mut env = environment(&["--input", "foo", "--announce", "wss://tracker.btorrent.xyz"]); + fs::write(env.resolve("foo"), "").unwrap(); + env.run().unwrap(); + let torrent = env.resolve("foo.torrent"); + let bytes = fs::read(torrent).unwrap(); + let metainfo = serde_bencode::de::from_bytes::(&bytes).unwrap(); + assert_eq!(metainfo.announce, "wss://tracker.btorrent.xyz/"); + assert!(metainfo.announce_list.is_none()); + } + #[test] fn announce_single_tier() { let mut env = environment(&[