Lines
100 %
Functions
Branches
#[cfg(feature = "indexmap")]
use ron::{de::from_str, Value};
#[test]
fn test_order_preserved() {
let file = r#"(
tasks: {
"debug message": Dbg(
msg: "test message. some text after it."
),
"shell command": Shell(
command: "ls",
args: Some([
"-l",
"-h",
]),
ch_dir: Some("/"),
},
)
"#;
let value: Value = from_str(file).unwrap();
match value {
Value::Map(map) => match &map[&Value::String("tasks".to_owned())] {
Value::Map(map) => {
assert_eq!(
*map.keys().next().unwrap(),
Value::String("debug message".to_string())
);
*map.keys().nth(1).unwrap(),
Value::String("shell command".to_string())
}
_ => panic!(), // GRCOV_EXCL_LINE
ch_dir: Some("/")