From bec651ef47efae5732e7b17c4d49e2718544d4c8 Mon Sep 17 00:00:00 2001 From: Afonso Bordado Date: Sat, 30 Jul 2022 22:05:39 +0100 Subject: [PATCH] Compare lines iterator instead of full output This avoids differences in line endings. --- .github/workflows/main.yml | 4 ---- build_system/tests.rs | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a75c4f97529..832572bcf35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,10 +79,6 @@ jobs: git config --global user.email "user@example.com" git config --global user.name "User" ./y.rs prepare - - - - name: log expected output - run: cat -e regex/examples/regexdna-output.txt - name: Build without unstable features env: diff --git a/build_system/tests.rs b/build_system/tests.rs index e4a776259c0..2c96c5cc175 100644 --- a/build_system/tests.rs +++ b/build_system/tests.rs @@ -206,7 +206,8 @@ const fn new(config: &'static str, func: &'static dyn Fn(&TestRunner)) -> Self { .join("\r\n"); - if output != expected { + let output_matches = expected.lines().eq(output.lines()); + if !output_matches { let res_path = PathBuf::from("res.txt"); fs::write(&res_path, &output).unwrap(); @@ -457,7 +458,6 @@ fn run_out_command<'a, I>(&self, name: &str, args: I) full_cmd.push(arg.to_string()); } - println!("full_CMD: {:?}", full_cmd); let mut cmd_iter = full_cmd.into_iter(); let first = cmd_iter.next().unwrap();