Make Lua snapshot middleware test sort maps

This commit is contained in:
Lucien Greathouse
2019-10-08 16:03:15 -07:00
parent f83abe15cb
commit 2957e8ad73

View File

@@ -159,7 +159,7 @@ fn match_trailing<'a>(input: &'a str, trailer: &str) -> Option<&'a str> {
mod test {
use super::*;
use insta::assert_yaml_snapshot;
use insta::{assert_yaml_snapshot, with_settings};
use crate::imfs::{ImfsDebug, ImfsSnapshot, NoopFetcher};
@@ -264,6 +264,8 @@ mod test {
let entry = imfs.get("/bar.server.lua").unwrap();
let instance_snapshot = SnapshotLua::from_imfs(&mut imfs, &entry).unwrap().unwrap();
assert_yaml_snapshot!(instance_snapshot);
with_settings!({ sort_maps => true }, {
assert_yaml_snapshot!(instance_snapshot);
});
}
}