From c13268dd7b771f5ecb29e57dc6b062e7b5d09d52 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Mon, 13 Jan 2025 16:07:04 +0000 Subject: [PATCH] e2e test for a private torrent file serde --- crates/librqbit_core/src/resources/test/private.torrent | 1 + crates/librqbit_core/src/torrent_metainfo.rs | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 crates/librqbit_core/src/resources/test/private.torrent diff --git a/crates/librqbit_core/src/resources/test/private.torrent b/crates/librqbit_core/src/resources/test/private.torrent new file mode 100644 index 0000000..f737e4c --- /dev/null +++ b/crates/librqbit_core/src/resources/test/private.torrent @@ -0,0 +1 @@ +d10:created by20:qBittorrent v4.4.3.113:creation datei1736784212e4:infod6:lengthi2e4:name7:private12:piece lengthi16384e6:pieces20:åúDò³µS¶s`Ð}]‘ÿ^7:privatei1eee \ No newline at end of file diff --git a/crates/librqbit_core/src/torrent_metainfo.rs b/crates/librqbit_core/src/torrent_metainfo.rs index 1d026ef..c5b0ea0 100644 --- a/crates/librqbit_core/src/torrent_metainfo.rs +++ b/crates/librqbit_core/src/torrent_metainfo.rs @@ -509,4 +509,11 @@ mod tests { } } } + + #[test] + fn test_private_real_torrent() { + let buf = include_bytes!("resources/test/private.torrent"); + let torrent: TorrentMetaV1Borrowed = torrent_from_bytes(buf).unwrap(); + assert!(torrent.info.private); + } }