| 1 | #![feature(test)] |
| 2 | |
| 3 | extern crate test; |
| 4 | |
| 5 | use dissimilar::diff; |
| 6 | use std::{fs, io}; |
| 7 | use test::Bencher; |
| 8 | |
| 9 | #[bench] |
| 10 | fn bench(b: &mut Bencher) -> io::Result<()> { |
| 11 | let document1 = fs::read_to_string("benches/document1.txt")?; |
| 12 | let document2 = fs::read_to_string("benches/document2.txt")?; |
| 13 | b.iter(|| diff(&document1, &document2)); |
| 14 | Ok(()) |
| 15 | } |