Exemple #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))
Exemple #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))
 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))
Exemple #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")
Exemple #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))
 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))
Exemple #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)
Exemple #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)
Exemple #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)
 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)
Exemple #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.",
     )
 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')
 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)
 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.'
     )
Exemple #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)
    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)
Exemple #17
0
 def test_3(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="abc", targetText="abc")[1]
     self.assertEqual(string, "abc")
 def test_7(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='abc\ndef',
                  targetText='gh\nijkl')[1]
     self.assertEqual(string, '\n')
 def test_6(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Niederösterreich',
                  targetText='Oberösterreich')[1]
     self.assertEqual(string, 'erösterreich')
Exemple #20
0
 def test_6(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Niederösterreich", targetText="Oberösterreich")[
         1
     ]
     self.assertEqual(string, "erösterreich")
Exemple #21
0
 def test_4(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Fox", targetText="Bear")[1]
     self.assertEqual(string, "")
Exemple #22
0
 def test_6(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Niederösterreich',
                  targetSubstring = 'Oberösterreich')[2]
     self.assertEqual(string, 'erösterreich')
Exemple #23
0
 def test_4(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Fox',
                  targetSubstring = 'Bear')[2]
     self.assertEqual(string, '')
Exemple #24
0
 def test_7(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="abc\ndef", targetText="gh\nijkl")[1]
     self.assertEqual(string, "\n")
 def test_5(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Fußball',
                  targetText='Football')[1]
     self.assertEqual(string, 'Fball')
Exemple #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.')
Exemple #27
0
 def test_5(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Fußball", targetText="Football")[1]
     self.assertEqual(string, "Fball")
Exemple #28
0
 def test_3(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'abc',
                  targetSubstring = 'abc')[2]
     self.assertEqual(string, 'abc')
Exemple #29
0
 def test_7(self):
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = 'abc\ndef',
                  targetText = 'gh\nijkl')[1]
     self.assertEqual(string, '\n')
Exemple #30
0
 def test_5(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Fußball',
                  targetSubstring = 'Football')[2]
     self.assertEqual(string, 'Fball')
 def test_3(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='abc',
                  targetText='abc')[1]
     self.assertEqual(string, 'abc')
Exemple #32
0
 def test_7(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'abc\ndef',
                  targetSubstring = 'gh\nijkl')[2]
     self.assertEqual(string, '\n')
 def test_4(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Fox',
                  targetText='Bear')[1]
     self.assertEqual(string, '')
Exemple #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')
Exemple #35
0
 def test_4(self):
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = 'Fox',
                  targetText = 'Bear')[1]
     self.assertEqual(string, '')