starcoin icon indicating copy to clipboard operation
starcoin copied to clipboard

[MPM] Executing the integration test on the Windows platform will cause the verification failure due to the newline of the exp file being replaced by CRLF

Open yubing744 opened this issue 2 years ago • 1 comments

Bug Report

Executing the integration test on the Windows platform will cause the verification failure due to the newline of the exp file being replaced by CRLF

OS: Windows 10 mpm: v1.11.9-alpha

Current behavior:

image

Expected behavior:

Verified

Steps to reproduce:

  git config --global core.autocrlf true
  git clone https://github.com/starcoinorg/guide-to-move-package-manager.git
  cd simple-nft
  mv spectests integration-tests
  mpm.exe integration-test

yubing744 avatar May 12 '22 01:05 yubing744

The test output comparison should ignore the CRLF

https://github.com/move-language/move/blob/8958b40e97a4f94a588e5365fdb90ec18f00d888/language/testing-infra/transactional-test-runner/src/framework.rs#L742

let expected_output = std::fs::read_to_string(&exp_path).unwrap();
    if output != expected_output {
        let msg = format!(
            "Expected errors differ from actual errors:\n{}",
            format_diff(expected_output, output),
        );
        anyhow::bail!(msg)
    } else {
        Ok(())
    }

jolestar avatar May 12 '22 02:05 jolestar