We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
data
ExpectFile
1 parent 93b703b commit 6ff13e4Copy full SHA for 6ff13e4
src/lib.rs
@@ -434,7 +434,7 @@ fn find_str_lit_len(str_lit_to_eof: &str) -> Option<usize> {
434
impl ExpectFile {
435
/// Checks if file contents is equal to `actual`.
436
pub fn assert_eq(&self, actual: &str) {
437
- let expected = self.read();
+ let expected = self.data();
438
if actual == expected {
439
return;
440
}
@@ -445,7 +445,8 @@ impl ExpectFile {
445
let actual = format!("{:#?}\n", actual);
446
self.assert_eq(&actual)
447
448
- fn read(&self) -> String {
+ /// Returns the content of this expect.
449
+ pub fn data(&self) -> String {
450
fs::read_to_string(self.abs_path()).unwrap_or_default().replace("\r\n", "\n")
451
452
fn write(&self, contents: &str) {
0 commit comments