mirror of
https://github.com/OMGeeky/confique.git
synced 2026-02-23 15:38:30 +01:00
Add YAML formatting tests
This commit is contained in:
@@ -255,7 +255,6 @@ mod tests {
|
||||
fn no_comments() {
|
||||
let out = format::<test_utils::example1::Conf>(FormatOptions {
|
||||
comments: false,
|
||||
indent: 0,
|
||||
.. FormatOptions::default()
|
||||
});
|
||||
assert_str_eq!(&out, include_format_output!("1-no-comments.toml"));
|
||||
|
||||
23
src/yaml.rs
23
src/yaml.rs
@@ -229,3 +229,26 @@ impl fmt::Display for PrintExpr {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::test_utils::{self, include_format_output};
|
||||
use super::{format, FormatOptions};
|
||||
use pretty_assertions::assert_str_eq;
|
||||
|
||||
#[test]
|
||||
fn default() {
|
||||
let out = format::<test_utils::example1::Conf>(FormatOptions::default());
|
||||
assert_str_eq!(&out, include_format_output!("1-default.yaml"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_comments() {
|
||||
let out = format::<test_utils::example1::Conf>(FormatOptions {
|
||||
comments: false,
|
||||
.. FormatOptions::default()
|
||||
});
|
||||
assert_str_eq!(&out, include_format_output!("1-no-comments.yaml"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user