Test that wss:// trackers are accepted

type: testing
This commit is contained in:
Casey Rodarmor 2020-01-31 04:21:55 -08:00
parent a6745e2a41
commit 6461a00ba3
No known key found for this signature in database
GPG Key ID: 556186B153EC6FE0

View File

@ -287,6 +287,18 @@ mod tests {
assert!(metainfo.announce_list.is_none()); 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::<Metainfo>(&bytes).unwrap();
assert_eq!(metainfo.announce, "wss://tracker.btorrent.xyz/");
assert!(metainfo.announce_list.is_none());
}
#[test] #[test]
fn announce_single_tier() { fn announce_single_tier() {
let mut env = environment(&[ let mut env = environment(&[