Skip to content

Commit

Permalink
filetree: Use .write_all() in tests
Browse files Browse the repository at this point in the history
This clippy lint catches a real bug.
  • Loading branch information
cgwalters committed May 4, 2023
1 parent c8c6785 commit 27e291e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/filetree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ mod tests {
assert_eq!(diff.count(), 0);
{
let mut bar = a.write_file("foo/bar", 0o644)?;
bar.write("foobarcontents".as_bytes())?;
bar.write_all("foobarcontents".as_bytes())?;
}
let diff = run_diff(&a, &b)?;
assert_eq!(diff.count(), 1);
Expand All @@ -457,14 +457,14 @@ mod tests {
b.create_dir("foo", 0o755)?;
{
let mut bar = b.write_file("foo/bar", 0o644)?;
bar.write("foobarcontents".as_bytes())?;
bar.write_all("foobarcontents".as_bytes())?;
}
let diff = run_diff(&a, &b)?;
assert_eq!(diff.count(), 0);
test_apply(&pa, &pb).context("testing apply 2")?;
{
let mut bar2 = b.write_file("foo/bar", 0o644)?;
bar2.write("foobarcontents2".as_bytes())?;
bar2.write_all("foobarcontents2".as_bytes())?;
}
let diff = run_diff(&a, &b)?;
assert_eq!(diff.count(), 1);
Expand Down

0 comments on commit 27e291e

Please sign in to comment.