Ejemplo n.º 1
0
 def test_12(self):
     index = lcs(searchAnchor = 6,
             # Place searchAnchor between ``bwxyzc`` and ``d``.
             searchText = 'bwxyzcd',
             targetText = 'bqwc?xyzaad')[0]
             # The expected targetText index is between ``bqwc?xyza`` and ``d``.
     self.assertIn(index, (8, 9, 10))
Ejemplo n.º 2
0
 def test_14(self):
     index = lcs(searchAnchor = 1,
                 returnLcsString = True,
                 # Place searchAnchor between ``a`` and ``b``.
                 searchText = 'ab',
                 targetText = 'a--b')[0]
                 # The expected targetText index is between ``a`` and ``b``.
     self.assertIn(index, (1, 2, 3))
Ejemplo n.º 3
0
 def test_12(self):
     index = lcs(
         searchAnchor=6,
         # Place searchAnchor between ``bwxyzc`` and ``d``.
         searchText='bwxyzcd',
         targetText='bqwc?xyzaad')[0]
     # The expected targetText index is between ``bqwc?xyza`` and ``d``.
     self.assertIn(index, (8, 9, 10))
Ejemplo n.º 4
0
 def test_9(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText="age = None# `exclude_patterns# <http://sphinx-doc.org/config.html#confval-exclude_patterns>`_: List of# patterns, re",
         targetText="for a list of supported languages.##language = None exclude_patterns: List of patterns, re",
     )[1]
     self.assertEqual(string, "a  o upte ngg.lnaexclude_patterns: List of patterns, re")
Ejemplo n.º 5
0
 def test_11(self):
     index = lcs(
         searchAnchor=9,
         # Place searchAnchor between ``bqwc?xyza`` and ``ad``.
         searchText="bqwc?xyzaad",
         targetText="bwxyzcd",
     )[0]
     # The expected targetText index is between ``bwxyzc`` and ``d``.
     self.assertIn(index, (5, 6))
Ejemplo n.º 6
0
 def test_14(self):
     index = lcs(
         searchAnchor=1,
         returnLcsString=True,
         # Place searchAnchor between ``a`` and ``b``.
         searchText='ab',
         targetText='a--b')[0]
     # The expected targetText index is between ``a`` and ``b``.
     self.assertIn(index, (1, 2, 3))
Ejemplo n.º 7
0
 def test_15(self):
     index = lcs(searchAnchor = 10,
                 returnLcsString = True,
                 # Place searchAnchor between ``Chapter 1:`` and
                 # ``Once upon a time``.
                 searchText = 'Chapter 1:Once upon a time',
                 targetText = ':---------Once upon a time')[0]
                 # The expected targetText index is between ``:---------``
                 # and ``Once upon a time``.
     self.assertEqual(index, 10)
Ejemplo n.º 8
0
 def test_10(self):
     print os.getcwd()
     with open("D:\\enki\\tests\\test_plugins\\test_ApproxMatch.py", 'r') as file:
         searchText = file.read()
     targetText = searchText
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = searchText,
                  targetText = targetText)[1]
     self.assertEqual(string, searchText)
Ejemplo n.º 9
0
 def test_16(self):
     index = lcs(searchAnchor = 16,
                 returnLcsString = True,
                 # Place searchAnchor between ``Once upon a time`` and
                 # ``, there lived``.
                 searchText = 'Once upon a time, there lived',
                 targetText = 'Once upon a time------------,')[0]
                 # The expected targetText index is between
                 # ``Once upon a time`` and ``------------,``.
     self.assertEqual(index, 16)
Ejemplo n.º 10
0
 def test_16(self):
     index = lcs(
         searchAnchor=16,
         returnLcsString=True,
         # Place searchAnchor between ``Once upon a time`` and
         # ``, there lived``.
         searchText='Once upon a time, there lived',
         targetText='Once upon a time------------,')[0]
     # The expected targetText index is between
     # ``Once upon a time`` and ``------------,``.
     self.assertEqual(index, 16)
Ejemplo n.º 11
0
 def test_8(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText="# The :doc:`README` user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.",
         targetText="The CodeChat user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.",
     )[1]
     self.assertEqual(
         string,
         "The d user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.",
     )
Ejemplo n.º 12
0
 def test_9(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText=
         'age = None# `exclude_patterns# <http://sphinx-doc.org/config.html#confval-exclude_patterns>`_: List of# patterns, re',
         targetText=
         'for a list of supported languages.##language = None exclude_patterns: List of patterns, re'
     )[1]
     self.assertEqual(
         string, 'a  o upte ngg.lnaexclude_patterns: List of patterns, re')
Ejemplo n.º 13
0
 def test_15(self):
     index = lcs(
         searchAnchor=10,
         returnLcsString=True,
         # Place searchAnchor between ``Chapter 1:`` and
         # ``Once upon a time``.
         searchText='Chapter 1:Once upon a time',
         targetText=':---------Once upon a time')[0]
     # The expected targetText index is between ``:---------``
     # and ``Once upon a time``.
     self.assertEqual(index, 10)
Ejemplo n.º 14
0
 def test_8(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText=
         '# The :doc:`README` user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.',
         targetText=
         'The CodeChat user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.'
     )[1]
     self.assertEqual(
         string,
         'The d user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.'
     )
Ejemplo n.º 15
0
    def test_13(self):
        index = lcs(searchAnchor = 30,
                    returnLcsString = True,
                    # Place searchAnchor between ``| '`` and ``Text after block 1,2, and 3``.
                    searchText = '------------+-------------+\n' +
                                 '| Text after block 1,2, and 3   ',
                    targetText = """a 2

Bael 2
Coco 3 Cherry 3
Text after block 1,2, and 3""")[0]
                    # The expected targetText index is at the beginning of the
                    # line ``Text after block 1,2, and 3``.
        self.assertEqual(index, 28)
Ejemplo n.º 16
0
    def test_13(self):
        index = lcs(
            searchAnchor=30,
            returnLcsString=True,
            # Place searchAnchor between ``| '`` and ``Text after block 1,2, and 3``.
            searchText='------------+-------------+\n' +
            '| Text after block 1,2, and 3   ',
            targetText="""a 2

Bael 2
Coco 3 Cherry 3
Text after block 1,2, and 3""")[0]
        # The expected targetText index is at the beginning of the
        # line ``Text after block 1,2, and 3``.
        self.assertEqual(index, 28)
Ejemplo n.º 17
0
 def test_3(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="abc", targetText="abc")[1]
     self.assertEqual(string, "abc")
Ejemplo n.º 18
0
 def test_7(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='abc\ndef',
                  targetText='gh\nijkl')[1]
     self.assertEqual(string, '\n')
Ejemplo n.º 19
0
 def test_6(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Niederösterreich',
                  targetText='Oberösterreich')[1]
     self.assertEqual(string, 'erösterreich')
Ejemplo n.º 20
0
 def test_6(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Niederösterreich", targetText="Oberösterreich")[
         1
     ]
     self.assertEqual(string, "erösterreich")
Ejemplo n.º 21
0
 def test_4(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Fox", targetText="Bear")[1]
     self.assertEqual(string, "")
Ejemplo n.º 22
0
 def test_6(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Niederösterreich',
                  targetSubstring = 'Oberösterreich')[2]
     self.assertEqual(string, 'erösterreich')
Ejemplo n.º 23
0
 def test_4(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Fox',
                  targetSubstring = 'Bear')[2]
     self.assertEqual(string, '')
Ejemplo n.º 24
0
 def test_7(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="abc\ndef", targetText="gh\nijkl")[1]
     self.assertEqual(string, "\n")
Ejemplo n.º 25
0
 def test_5(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Fußball',
                  targetText='Football')[1]
     self.assertEqual(string, 'Fball')
Ejemplo n.º 26
0
 def test_8(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = '# The :doc:`README` user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.',
                  targetSubstring = 'The CodeChat user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.')[2]
     self.assertEqual(string, 'The d user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.')
Ejemplo n.º 27
0
 def test_5(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Fußball", targetText="Football")[1]
     self.assertEqual(string, "Fball")
Ejemplo n.º 28
0
 def test_3(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'abc',
                  targetSubstring = 'abc')[2]
     self.assertEqual(string, 'abc')
Ejemplo n.º 29
0
 def test_7(self):
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = 'abc\ndef',
                  targetText = 'gh\nijkl')[1]
     self.assertEqual(string, '\n')
Ejemplo n.º 30
0
 def test_5(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Fußball',
                  targetSubstring = 'Football')[2]
     self.assertEqual(string, 'Fball')
Ejemplo n.º 31
0
 def test_3(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='abc',
                  targetText='abc')[1]
     self.assertEqual(string, 'abc')
Ejemplo n.º 32
0
 def test_7(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'abc\ndef',
                  targetSubstring = 'gh\nijkl')[2]
     self.assertEqual(string, '\n')
Ejemplo n.º 33
0
 def test_4(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Fox',
                  targetText='Bear')[1]
     self.assertEqual(string, '')
Ejemplo n.º 34
0
 def test_9(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'age = None# `exclude_patterns# <http://sphinx-doc.org/config.html#confval-exclude_patterns>`_: List of# patterns, re',
                  targetSubstring = 'for a list of supported languages.##language = None exclude_patterns: List of patterns, re')[2]
     self.assertEqual(string, 'a  o upte ngg.lnaexclude_patterns: List of patterns, re')
Ejemplo n.º 35
0
 def test_4(self):
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = 'Fox',
                  targetText = 'Bear')[1]
     self.assertEqual(string, '')