From ceb94ece2aa6a1b54063c582663fff4c1937d989 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 11 Feb 2018 11:19:54 +0300 Subject: G: pointer types --- tests/testutils/src/lib.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tests/testutils/src/lib.rs') diff --git a/tests/testutils/src/lib.rs b/tests/testutils/src/lib.rs index b50e70849..ae1dea810 100644 --- a/tests/testutils/src/lib.rs +++ b/tests/testutils/src/lib.rs @@ -26,21 +26,20 @@ where F: Fn(&str) -> String, { for path in collect_tests(paths) { - let actual = { - let text = read_text(&path); - f(&text) - }; + let input_code = read_text(&path); + let parse_tree = f(&input_code); let path = path.with_extension("txt"); if !path.exists() { println!("\nfile: {}", path.display()); - println!("No .txt file with expected result, creating..."); - file::put_text(&path, actual).unwrap(); + println!("No .txt file with expected result, creating...\n"); + println!("{}\n{}", input_code, parse_tree); + file::put_text(&path, parse_tree).unwrap(); panic!("No expected result") } let expected = read_text(&path); let expected = expected.as_str(); - let actual = actual.as_str(); - assert_equal_text(expected, actual, &path); + let parse_tree = parse_tree.as_str(); + assert_equal_text(expected, parse_tree, &path); } } -- cgit v1.2.3