@@ -16,32 +16,6 @@ void testMinDistance(String str1, String str2, int expected) {
1616 assertEquals (expected , EditDistance .minDistance (str1 , str2 ));
1717 }
1818
19- @ Test
20- void testEditDistanceStringNull () {
21- assertThrows (NullPointerException .class , () -> { EditDistance .editDistance (null , "abc" ); });
22- assertThrows (NullPointerException .class , () -> { EditDistance .editDistance ("abc" , null ); });
23- assertThrows (NullPointerException .class , () -> { EditDistance .editDistance (null , null ); });
24- }
25-
26- @ Test
27- void testEditDistanceStringEmpty () {
28- int expected = 0 ;
29- assertEquals (0 , EditDistance .editDistance ("" , "" ));
30- String s1 = "abc" ;
31- expected = s1 .length ();
32- assertEquals (expected , EditDistance .editDistance (s1 , "" ));
33- String s2 = "aa" ;
34- expected = s2 .length ();
35- assertEquals (expected , EditDistance .editDistance ("" , s2 ));
36- }
37-
38- @ Test
39- void testEditDistanceNullValue () {
40- assertThrows (NullPointerException .class , () -> { EditDistance .editDistance (null , "hello" ); });
41- assertThrows (NullPointerException .class , () -> { EditDistance .editDistance ("hello" , null ); });
42- assertThrows (NullPointerException .class , () -> { EditDistance .editDistance (null , null ); });
43- }
44-
4519 @ Test
4620 public void testEditDistanceBothEmptyStrings () {
4721 assertEquals (0 , EditDistance .editDistance ("" , "" ));
0 commit comments