Add a failing test of zero context.
@@ -169,7 +169,7 @@ mod test {
use super::DiffLine::*;
#[test]
- fn simple_diff() {
+ fn diff_simple() {
let src = "one\ntwo\nthree\nfour\nfive\n";
let dest= "one\ntwo\ntrois\nfour\nfive\n";
let diff = make_diff(src, dest, 1);
@@ -181,4 +181,16 @@ mod test {
Context("four".into()),
] }]);
}
+
+ #[test]
+ fn diff_zerocontext() {
+ let src = "one\ntwo\nthree\nfour\nfive\n";
+ let dest= "one\ntwo\ntrois\nfour\nfive\n";
+ let diff = make_diff(src, dest, 0);
+ assert_eq!(diff, vec![Mismatch { line_number: 3,
+ lines: vec![
+ Resulting("three".into()),
+ Expected("trois".into()),
+ ] }]);
+ }
}
\ No newline at end of file
