Remove testing macros from docs
This commit is contained in:
@@ -244,9 +244,8 @@ fn default_visitor() {
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
mod testing {
|
||||
#[macro_export]
|
||||
macro_rules! test_for_type {
|
||||
#[macro_export]
|
||||
macro_rules! test_for_type {
|
||||
($type:ty, $value:expr, $content:expr) => {{
|
||||
#[derive(Debug, PartialEq, YaDeserialize, YaSerialize)]
|
||||
#[yaserde(rename = "data")]
|
||||
@@ -266,10 +265,11 @@ mod testing {
|
||||
serialize_and_validate!(model, content);
|
||||
deserialize_and_validate!(&content, model, Data);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! test_for_attribute_type {
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! test_for_attribute_type {
|
||||
($type: ty, $value: expr, $content: expr) => {{
|
||||
#[derive(Debug, PartialEq, YaDeserialize, YaSerialize)]
|
||||
#[yaserde(rename = "data")]
|
||||
@@ -288,19 +288,21 @@ mod testing {
|
||||
serialize_and_validate!(model, content);
|
||||
deserialize_and_validate!(&content, model, Data);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! deserialize_and_validate {
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! deserialize_and_validate {
|
||||
($content: expr, $model: expr, $struct: tt) => {
|
||||
log::debug!("deserialize_and_validate @ {}:{}", file!(), line!());
|
||||
let loaded: Result<$struct, String> = yaserde::de::from_str($content);
|
||||
assert_eq!(loaded, Ok($model));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! serialize_and_validate {
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! serialize_and_validate {
|
||||
($model: expr, $content: expr) => {
|
||||
log::debug!("serialize_and_validate @ {}:{}", file!(), line!());
|
||||
let data: Result<String, String> = yaserde::ser::to_string(&$model);
|
||||
@@ -311,5 +313,4 @@ mod testing {
|
||||
Ok(content.split("\n").map(|s| s.trim()).collect::<String>())
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user