aconfig: improve code diffs in tests
Implement a helper function to make it easier for unit tests to diff (and find the first difference) generated code and expected code. Bug: 283910447 Test: atest aconfig.test Change-Id: I460e8fbf05e8f33e8a62ecef67b2d9d77051e876
This commit is contained in:
@@ -126,6 +126,12 @@ pub fn r#enabled_rw() -> bool {
|
||||
}
|
||||
}
|
||||
"#;
|
||||
assert_eq!(expected.trim(), String::from_utf8(generated.contents).unwrap().trim());
|
||||
assert_eq!(
|
||||
None,
|
||||
crate::test::first_significant_code_diff(
|
||||
expected,
|
||||
&String::from_utf8(generated.contents).unwrap()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user