From 501bf4bcb53a21dc339b44c4560968c42cf08735 Mon Sep 17 00:00:00 2001 From: jiangying Date: Mon, 16 May 2022 13:07:10 +0800 Subject: [PATCH] fix test failure on compare lines ending with "\r\n" and "\n" (#132) * [fix] fix test failure on "crlf" https://github.com/starcoinorg/starcoin/issues/3401 * restore M.move symlink Signed-off-by: satyamacn Closes: #340 --- .../testing-infra/transactional-test-runner/src/framework.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/language/testing-infra/transactional-test-runner/src/framework.rs b/language/testing-infra/transactional-test-runner/src/framework.rs index f1e521154c..1aebbb741d 100644 --- a/language/testing-infra/transactional-test-runner/src/framework.rs +++ b/language/testing-infra/transactional-test-runner/src/framework.rs @@ -724,7 +724,10 @@ fn handle_expected_output(test_path: &Path, output: impl AsRef) -> Result<( if !exp_path.exists() { std::fs::write(&exp_path, "").unwrap(); } - let expected_output = std::fs::read_to_string(&exp_path).unwrap(); + let expected_output = std::fs::read_to_string(&exp_path) + .unwrap() + .replace("\r\n", "\n") + .replace("\r", "\n"); if output != expected_output { let msg = format!( "Expected errors differ from actual errors:\n{}",