Remove sync-only trait `XmlSource` from the `check!` macro
That change will allow us to reuse `check!` macro for testing async code
@@ -935,7 +935,7 @@ mod test {
macro_rules! check {
($buf:expr) => {
mod read_bytes_until {
- use crate::reader::XmlSource;
+ use super::*;
// Use Bytes for printing bytes as strings for ASCII range
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1039,10 +1039,13 @@ mod test {
}
mod read_bang_element {
+ use super::*;
+
/// Checks that reading CDATA content works correctly
mod cdata {
+ use super::*;
use crate::errors::Error;
- use crate::reader::{BangType, XmlSource};
+ use crate::reader::BangType;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1143,8 +1146,9 @@ mod test {
///
/// [specification]: https://www.w3.org/TR/xml11/#dt-comment
mod comment {
+ use super::*;
use crate::errors::Error;
- use crate::reader::{BangType, XmlSource};
+ use crate::reader::BangType;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1276,9 +1280,12 @@ mod test {
/// Checks that reading DOCTYPE definition works correctly
mod doctype {
+ use super::*;
+
mod uppercase {
+ use super::*;
use crate::errors::Error;
- use crate::reader::{BangType, XmlSource};
+ use crate::reader::BangType;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1355,8 +1362,9 @@ mod test {
}
mod lowercase {
+ use super::*;
use crate::errors::Error;
- use crate::reader::{BangType, XmlSource};
+ use crate::reader::BangType;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1435,7 +1443,7 @@ mod test {
}
mod read_element {
- use crate::reader::XmlSource;
+ use super::*;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1452,7 +1460,7 @@ mod test {
}
mod open {
- use crate::reader::XmlSource;
+ use super::*;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1528,7 +1536,7 @@ mod test {
}
mod self_closed {
- use crate::reader::XmlSource;
+ use super::*;
use crate::utils::Bytes;
use pretty_assertions::assert_eq;
@@ -1798,11 +1806,15 @@ mod test {
/// Tests for reader that generates events that borrow from the provided buffer
mod buffered {
+ use crate::reader::XmlSource;
+
check!(&mut Vec::new());
}
/// Tests for reader that generates events that borrow from the input
mod borrowed {
+ use crate::reader::XmlSource;
+
check!(());
}
}
