Skip to content

Commit

Permalink
Test UDP tracker URLs parse
Browse files Browse the repository at this point in the history
Also change UDP tracker protocol extensions from unsupported to N/A.

type: testing
  • Loading branch information
casey committed Apr 8, 2020
1 parent 0560181 commit a8446c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ at any time.
| [38](http://bittorrent.org/beps/bep_0038.html) | :heavy_minus_sign: | Finding Local Data Via Torrent File Hints |
| [39](http://bittorrent.org/beps/bep_0039.html) | [:x:](https://github.com/casey/intermodal/issues/98) | Updating Torrents Via Feed URL |
| [40](http://bittorrent.org/beps/bep_0040.html) | :heavy_minus_sign: | Canonical Peer Priority |
| [41](http://bittorrent.org/beps/bep_0041.html) | [:x:](https://github.com/casey/intermodal/issues/97) | UDP Tracker Protocol Extensions |
| [41](http://bittorrent.org/beps/bep_0041.html) | :heavy_minus_sign: | UDP Tracker Protocol Extensions |
| [42](http://bittorrent.org/beps/bep_0042.html) | :heavy_minus_sign: | DHT Security extension |
| [43](http://bittorrent.org/beps/bep_0043.html) | :heavy_minus_sign: | Read-only DHT Nodes |
| [44](http://bittorrent.org/beps/bep_0044.html) | :heavy_minus_sign: | Storing arbitrary data in the DHT |
Expand Down
20 changes: 20 additions & 0 deletions src/torrent/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,26 @@ mod tests {
assert!(metainfo.announce_list.is_none());
}

#[test]
fn announce_udp() {
let mut env = environment(&[
"--input",
"foo",
"--announce",
"udp://tracker.opentrackr.org:1337/announce",
]);
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,
"udp://tracker.opentrackr.org:1337/announce"
);
assert!(metainfo.announce_list.is_none());
}

#[test]
fn announce_single_tier() {
let mut env = environment(&[
Expand Down

0 comments on commit a8446c8

Please sign in to comment.