From fbbf8d797333a85a3eb2cfac0804834d2052e0d5 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Mon, 11 Dec 2023 19:37:43 +0000 Subject: [PATCH 1/2] add better error message --- tooling/nargo_cli/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tooling/nargo_cli/build.rs b/tooling/nargo_cli/build.rs index 27a9b83d836..1667a88ce63 100644 --- a/tooling/nargo_cli/build.rs +++ b/tooling/nargo_cli/build.rs @@ -201,7 +201,9 @@ fn compile_success_empty_{test_name}() {{ }} // `compile_success_empty` tests should be able to compile down to an empty circuit. - let json: serde_json::Value = serde_json::from_slice(&output.stdout).expect("JSON was not well-formatted"); + let json: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap_or_else(|| {{ + panic!("JSON was not well-formatted {{}}",output.stdout) + }}); let num_opcodes = &json["programs"][0]["acir_opcodes"]; assert_eq!(num_opcodes.as_u64().unwrap(), 0); }} From 4f4e61ec6a89ff3b8794b73db0fb540d23c00823 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Mon, 11 Dec 2023 19:44:40 +0000 Subject: [PATCH 2/2] fix: debug format and `_` --- tooling/nargo_cli/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tooling/nargo_cli/build.rs b/tooling/nargo_cli/build.rs index 1667a88ce63..6f6d65ee89c 100644 --- a/tooling/nargo_cli/build.rs +++ b/tooling/nargo_cli/build.rs @@ -201,8 +201,8 @@ fn compile_success_empty_{test_name}() {{ }} // `compile_success_empty` tests should be able to compile down to an empty circuit. - let json: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap_or_else(|| {{ - panic!("JSON was not well-formatted {{}}",output.stdout) + let json: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap_or_else(|_| {{ + panic!("JSON was not well-formatted {{:?}}",output.stdout) }}); let num_opcodes = &json["programs"][0]["acir_opcodes"]; assert_eq!(num_opcodes.as_u64().unwrap(), 0);