]> git.lizzy.rs Git - rust.git/commitdiff
Compare lines iterator instead of full output
authorAfonso Bordado <afonsobordado@az8.co>
Sat, 30 Jul 2022 21:05:39 +0000 (22:05 +0100)
committerAfonso Bordado <afonsobordado@az8.co>
Sat, 30 Jul 2022 21:05:39 +0000 (22:05 +0100)
This avoids differences in line endings.

.github/workflows/main.yml
build_system/tests.rs

index a75c4f97529b8f499ff86135ea6c25142fb28224..832572bcf3596f5f399ef5ccd883a8a237ceab71 100644 (file)
@@ -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:
index e4a776259c06c858a256043b57f1c1d7364d46ca..2c96c5cc1754de9d532e6ef754620b4029176645 100644 (file)
@@ -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();