File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1- package testcase . diffutills ;
1+ package diffutills ;
22
33import java .util .*;
44
@@ -65,4 +65,18 @@ public void testDiff_Change() {
6565 }
6666 }), delta .getRevised ());
6767 }
68+
69+ public void testDiff_EmptyList () {
70+ Patch patch = DiffUtils .diff (new ArrayList <String >(), new ArrayList <String >());
71+ assertNotNull (patch );
72+ assertEquals (patch .getDeltas ().size (), 0 );
73+ }
74+
75+ public void testDiff_EmptyListWithNonEmpty () {
76+ Patch patch = DiffUtils .diff (new ArrayList <String >(), Arrays .asList ("aaa" ));
77+ assertNotNull (patch );
78+ assertEquals (patch .getDeltas ().size (), 1 );
79+ Delta delta = patch .getDeltas ().get (0 );
80+ assertEquals (InsertDelta .class , delta .getClass ());
81+ }
6882}
Original file line number Diff line number Diff line change 1- package testcase . diffutills ;
1+ package diffutills ;
22
33import java .io .BufferedReader ;
44import java .io .File ;
Original file line number Diff line number Diff line change 1- package testcase . diffutills ;
1+ package diffutills ;
22
33import java .util .Arrays ;
44import java .util .List ;
You can’t perform that action at this time.
0 commit comments