Skip to content

Commit

Permalink
fix: Fix tests in stream::tag module if "tokio" feature is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Nov 11, 2024
1 parent fd9f62e commit d3f4ac4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/stream/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl Header {
Ok(base_header.with_ext_header(ext_header_size))
}

#[cfg(any(feature = "tokio", test))]
#[cfg(any(feature = "tokio"))]
async fn async_decode(
mut reader: impl tokio::io::AsyncRead + std::marker::Unpin,
) -> crate::Result<Header> {
Expand Down Expand Up @@ -205,7 +205,7 @@ pub fn decode(mut reader: impl io::Read) -> crate::Result<Tag> {
decode_remaining(reader, header)
}

#[cfg(any(feature = "tokio", test))]
#[cfg(any(feature = "tokio"))]
pub async fn async_decode(
mut reader: impl tokio::io::AsyncRead + std::marker::Unpin,
) -> crate::Result<Tag> {
Expand Down Expand Up @@ -618,6 +618,7 @@ mod tests {
}
}

#[cfg(any(feature = "tokio"))]
#[tokio::test]
async fn read_id3v22_tokio() {
let mut file = tokio::fs::File::open("testdata/id3v22.id3").await.unwrap();
Expand Down Expand Up @@ -653,6 +654,7 @@ mod tests {
}
}

#[cfg(any(feature = "tokio"))]
#[tokio::test]
async fn read_id3v23_tokio() {
let mut file = tokio::fs::File::open("testdata/id3v23.id3").await.unwrap();
Expand Down Expand Up @@ -790,6 +792,7 @@ mod tests {
assert_eq!(2, tag.track().unwrap());
}

#[cfg(any(feature = "tokio"))]
#[tokio::test]
async fn read_id3v24_extended_tokio() {
let mut file = tokio::fs::File::open("testdata/id3v24_ext.id3")
Expand Down

0 comments on commit d3f4ac4

Please sign in to comment.