File: failure.rs

package info (click to toggle)
rust-assert-fs 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 228 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 293 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![allow(clippy::unwrap_used)]

use assert_fs::prelude::*;

fn main() {
    let temp = assert_fs::TempDir::new().unwrap();
    let input_file = temp.child("foo.txt");

    input_file.write_str("Hello\nWorld!").unwrap();

    input_file.assert("Goodbye\nWorld!");

    temp.close().unwrap();
}