From 570edb98690ac30518615a14bd12ddf4c9374937 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 24 Jan 2024 09:23:46 +0100 Subject: [PATCH] Check first and then print. --- backend/src/pilstark/json_exporter/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/pilstark/json_exporter/mod.rs b/backend/src/pilstark/json_exporter/mod.rs index dd5fd41a85..f658600b96 100644 --- a/backend/src/pilstark/json_exporter/mod.rs +++ b/backend/src/pilstark/json_exporter/mod.rs @@ -454,9 +454,11 @@ mod test { fn compare_export_file(file: &str) { let (json_out, pilcom_parsed) = generate_json_pair(file); - // TODO: test fails because PILCOM "fileName" fields output the filename - // stripped of its path - assert_eq!(json_out, pilcom_parsed); + if json_out != pilcom_parsed { + // Computing the pretty diff can take minutes, so we are printing an error already here. + eprintln!("Exported json and file re-exported by pilcom differ:"); + assert_eq!(json_out, pilcom_parsed); + } } /// Normalizes the json in that it replaces all idQ values by "99"