Fix tests

This commit is contained in:
Zykino 2022-12-04 14:24:26 +01:00
parent 971a19a6e0
commit 9f5cbd7d07

View File

@ -20,17 +20,21 @@ fn ron_to_json() {
let opt = Opt { let opt = Opt {
input: Input::Ron, input: Input::Ron,
output: Output::Json, output: Output::Json,
format_in: None,
format_out: None,
pretty: true, pretty: true,
no_newline: false, no_newline: false,
}; };
let input = example_to_vec("examples/materials.ron"); let input = example_to_vec("test-data/materials.ron");
let mut output = vec![]; let mut output = vec![];
transcode(opt, &mut input.as_slice(), &mut output); transcode(opt, &mut input.as_slice(), &mut output);
let out = String::from_utf8(output).unwrap(); let out = String::from_utf8(output).unwrap();
let control = example_to_string("examples/materials.json"); let control = example_to_string("test-data/materials.json");
assert_eq!(control, out); assert_eq!(control, out);
} }
@ -40,17 +44,21 @@ fn json5_read_json() {
let opt = Opt { let opt = Opt {
input: Input::Json5, input: Input::Json5,
output: Output::Json, output: Output::Json,
format_in: None,
format_out: None,
pretty: true, pretty: true,
no_newline: false, no_newline: false,
}; };
let input = example_to_vec("examples/materials.json"); let input = example_to_vec("test-data/materials.json");
let mut output = vec![]; let mut output = vec![];
transcode(opt, &mut input.as_slice(), &mut output); transcode(opt, &mut input.as_slice(), &mut output);
let out = String::from_utf8(output).unwrap(); let out = String::from_utf8(output).unwrap();
let control = example_to_string("examples/materials.json"); let control = example_to_string("test-data/materials.json");
assert_eq!(control, out); assert_eq!(control, out);
} }