From 9ab8f5e44e733e1ff08251af35ba793376ed2d1d Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 27 Nov 2023 19:41:07 +0000 Subject: [PATCH 1/2] chore: check for errors in formatter tests --- tooling/nargo_fmt/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tooling/nargo_fmt/build.rs b/tooling/nargo_fmt/build.rs index cd93866ece9..5f9583235a3 100644 --- a/tooling/nargo_fmt/build.rs +++ b/tooling/nargo_fmt/build.rs @@ -60,6 +60,8 @@ fn format_{test_name}() {{ let (parsed_module, errors) = noirc_frontend::parse_program(&input); + assert!(errors.is_empty(), "Encountered errors while parsing program); + let config = nargo_fmt::Config::of("{config}").unwrap(); let fmt_text = nargo_fmt::format(&input, parsed_module, &config); From 754e68f574f5ce0708ce3f599eb2eb56a04fa0a8 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:58:10 +0000 Subject: [PATCH 2/2] Update tooling/nargo_fmt/build.rs --- tooling/nargo_fmt/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tooling/nargo_fmt/build.rs b/tooling/nargo_fmt/build.rs index 5f9583235a3..30a0aed617a 100644 --- a/tooling/nargo_fmt/build.rs +++ b/tooling/nargo_fmt/build.rs @@ -58,9 +58,7 @@ fn format_{test_name}() {{ let expected_output = r#"{output_source}"#; - let (parsed_module, errors) = noirc_frontend::parse_program(&input); - - assert!(errors.is_empty(), "Encountered errors while parsing program); + let (parsed_module, _errors) = noirc_frontend::parse_program(&input); let config = nargo_fmt::Config::of("{config}").unwrap(); let fmt_text = nargo_fmt::format(&input, parsed_module, &config);