file_diff

Crates.iofile_diff
lib.rsfile_diff
version1.0.0
sourcesrc
created_at2014-12-23 22:54:38.286622
updated_at2016-04-10 02:04:36.78031
descriptionAn atomic utility for diffing files in testing
homepagehttps://github.com/ethanpailes/file_diff-rs
repositoryhttps://github.com/ethanpailes/file_diff-rs
max_upload_size
id632
size740,586
Ethan Pailes (ethanpailes)

documentation

README

File Diff

This module provides an atomic file diffing function for use in unit tests.

The diff_files() function takes two file handles and determines returns true if they point to identical files.

use file_diff::{diff_files};
use std::fs::{File};

let mut file1 = match File::open("./src/lib.rs") {
    Ok(f) => f,
    Err(e) => panic!("{}", e),
};
let mut file2 = match File::open("./src/lib.rs") {
    Ok(f) => f,
    Err(e) => panic!("{}", e),
};

diff_files(&mut file1, &mut file2);

The diff() function takes string representations of the files and returns true if the strings represent real files and those files are identical.

use file_diff::{diff};

diff("./src/lib.rs", "./src/lib.rs"); // true
Commit count: 16

cargo fmt