mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add a failing test of zero context.
This commit is contained in:
parent
88f02975a1
commit
6282c970cf
@ -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()),
|
||||
] }]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user