Пример #1
0
 def test_case_1(self):
     self.assertEqual(program.levenshteinDistance("", ""), 0)
Пример #2
0
Файл: sol.py Проект: dthinkcs/ps
1
import program
2
import unittest
3
​
4
​
5
class TestProgram(unittest.TestCase):
6
​
7
    def test_case_1(self):
8
        self.assertEqual(program.levenshteinDistance("", ""), 0)
9
​
10
    def test_case_2(self):
11
        self.assertEqual(program.levenshteinDistance("", "abc"), 3)
12
​
13
    def test_case_3(self):
14
        self.assertEqual(program.levenshteinDistance("abc", "abc"), 0)
15
​
16
Пример #3
0
 def test_case_14(self):
     self.assertEqual(program.levenshteinDistance("abc", "yabd"), 2)
Пример #4
0
 def test_case_15(self):
     self.assertEqual(program.levenshteinDistance("xabc", "abcx"), 2)
Пример #5
0
 def test_case_12(self):
     self.assertEqual(program.levenshteinDistance("cereal", "saturdzz"), 7)
Пример #6
0
 def test_case_13(self):
     self.assertEqual(
         program.levenshteinDistance("abbbbbbbbb", "bbbbbbbbba"), 2)
Пример #7
0
 def test_case_10(self):
     self.assertEqual(program.levenshteinDistance("biting", "mitten"), 4)
Пример #8
0
 def test_case_9(self):
     self.assertEqual(
         program.levenshteinDistance("abcdefghij", "a234567890"), 9)
Пример #9
0
 def test_case_7(self):
     self.assertEqual(
         program.levenshteinDistance("algoexpert", "algozexpert"), 1)
Пример #10
0
 def test_case_4(self):
     self.assertEqual(program.levenshteinDistance("abc", "abx"), 1)
Пример #11
0
 def test_case_2(self):
     self.assertEqual(program.levenshteinDistance("", "abc"), 3)