stream tests updated
@@ -15,10 +15,12 @@ fn stream_source() {
StreamSource::Torrent {
info_hash: [1; 20],
file_idx: Some(1),
+ announce: vec!["announce".to_owned()],
},
StreamSource::Torrent {
info_hash: [1; 20],
file_idx: None,
+ announce: vec![],
},
StreamSource::External {
external_url: Url::parse("https://external_url").unwrap(),
@@ -45,22 +47,29 @@ fn stream_source() {
Token::StructEnd,
Token::Struct {
name: "StreamSource",
- len: 2,
+ len: 3,
},
Token::Str("infoHash"),
Token::Str("0101010101010101010101010101010101010101"),
Token::Str("fileIdx"),
Token::Some,
Token::U16(1),
+ Token::Str("announce"),
+ Token::Seq { len: Some(1) },
+ Token::Str("announce"),
+ Token::SeqEnd,
Token::StructEnd,
Token::Struct {
name: "StreamSource",
- len: 2,
+ len: 3,
},
Token::Str("infoHash"),
Token::Str("0101010101010101010101010101010101010101"),
Token::Str("fileIdx"),
Token::None,
+ Token::Str("announce"),
+ Token::Seq { len: Some(0) },
+ Token::SeqEnd,
Token::StructEnd,
Token::Struct {
name: "StreamSource",
@@ -90,14 +99,17 @@ fn stream_source() {
StreamSource::Torrent {
info_hash: [1; 20],
file_idx: Some(1),
+ announce: vec!["announce".to_owned()],
},
StreamSource::Torrent {
info_hash: [1; 20],
file_idx: None,
+ announce: vec![],
},
StreamSource::Torrent {
info_hash: [1; 20],
file_idx: None,
+ announce: vec![],
},
StreamSource::External {
external_url: Url::parse("https://external_url").unwrap(),
@@ -124,26 +136,33 @@ fn stream_source() {
Token::StructEnd,
Token::Struct {
name: "StreamSource",
- len: 2,
+ len: 3,
},
Token::Str("infoHash"),
Token::BorrowedBytes(b"0101010101010101010101010101010101010101"),
Token::Str("fileIdx"),
Token::Some,
Token::U16(1),
+ Token::Str("announce"),
+ Token::Seq { len: Some(1) },
+ Token::Str("announce"),
+ Token::SeqEnd,
Token::StructEnd,
Token::Struct {
name: "StreamSource",
- len: 2,
+ len: 3,
},
Token::Str("infoHash"),
Token::BorrowedBytes(b"0101010101010101010101010101010101010101"),
Token::Str("fileIdx"),
Token::None,
+ Token::Str("announce"),
+ Token::Seq { len: Some(0) },
+ Token::SeqEnd,
Token::StructEnd,
Token::Struct {
name: "StreamSource",
- len: 2,
+ len: 1,
},
Token::Str("infoHash"),
Token::BorrowedBytes(b"0101010101010101010101010101010101010101"),
