Skip to content

Commit

Permalink
Add a failing test of zero context.
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglerchris committed Oct 19, 2017
1 parent 88f0297 commit 6282c97
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/rustfmt_diff.rs
Expand Up @@ -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);
Expand All @@ -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()),
] }]);
}
}

0 comments on commit 6282c97

Please sign in to comment.