Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes e2e tests using checks with UNIX paths. #3147

Merged
merged 2 commits into from
Oct 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/src/e2e_vm_tests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use fuel_vm::interpreter::Interpreter;
use fuel_vm::prelude::*;
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use regex::{Captures, Regex};
use std::{fmt::Write, fs, io::Read, path::PathBuf, str::FromStr};

use super::RunConfig;
Expand Down Expand Up @@ -149,6 +150,17 @@ pub(crate) fn compile_to_bytes(
if let Err(ref e) = result {
write!(output, "\n{}", e).expect("error writing output");
}

if cfg!(windows) {
// In windows output error and warning path files start with \\?\
// We replace \ by / so tests can check unix paths only
let regex = Regex::new(r"\\\\?\\(.*)").unwrap();
output = regex
.replace_all(output.as_str(), |caps: &Captures| {
caps[1].replace('\\', "/")
})
.to_string();
}
}

(result, output)
Expand Down