Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fda3d2b0 authored by Martin Geisler's avatar Martin Geisler Committed by Automerger Merge Worker
Browse files

PDL: Fix the order of arguments to ‘assert_eq_with_diff’ am: 14836669

parents e4aa3e92 14836669
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ mod tests {
    fn test_generate_preamble() {
        let actual_code = generate_preamble(Path::new("some/path/foo.pdl")).unwrap();
        let expected_code = include_str!("../test/generated/preamble.rs");
        assert_eq_with_diff(&rustfmt(&actual_code), &rustfmt(expected_code));
        assert_eq_with_diff(&rustfmt(expected_code), &rustfmt(&actual_code));
    }

    #[test]
@@ -512,7 +512,7 @@ mod tests {
        let decl = &grammar.declarations[0];
        let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap();
        let expected_code = include_str!("../test/generated/packet_decl_empty.rs");
        assert_eq_with_diff(&rustfmt(&actual_code), &rustfmt(expected_code));
        assert_eq_with_diff(&rustfmt(expected_code), &rustfmt(&actual_code));
    }

    #[test]
@@ -532,7 +532,7 @@ mod tests {
        let decl = &grammar.declarations[0];
        let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap();
        let expected_code = include_str!("../test/generated/packet_decl_simple_little_endian.rs");
        assert_eq_with_diff(&rustfmt(&actual_code), &rustfmt(expected_code));
        assert_eq_with_diff(&rustfmt(expected_code), &rustfmt(&actual_code));
    }

    #[test]
@@ -552,6 +552,6 @@ mod tests {
        let decl = &grammar.declarations[0];
        let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap();
        let expected_code = include_str!("../test/generated/packet_decl_simple_big_endian.rs");
        assert_eq_with_diff(&rustfmt(&actual_code), &rustfmt(expected_code));
        assert_eq_with_diff(&rustfmt(expected_code), &rustfmt(&actual_code));
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ pub fn rustfmt(input: &str) -> String {
    String::from_utf8(output.stdout).expect("rustfmt output was not UTF-8")
}

/// Compare two strings using `diff`
/// Find the unified diff between two strings using `diff`.
///
/// # Panics
///