|
|
@@ -102,7 +102,7 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
)
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
@@ -111,11 +111,11 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
|
|
|
self.assertSequenceEqual(patched_lines, [
|
|
|
"target_include_directories(leveldb",
|
|
|
- "# BEGIN: leveldb_include_start modification by MyCoolSript",
|
|
|
+ "# BEGIN: leveldb_include_start modification by MyCoolScript",
|
|
|
"PRIVATE",
|
|
|
"a/b",
|
|
|
"c/d",
|
|
|
- "# END: leveldb_include_start modification by MyCoolSript",
|
|
|
+ "# END: leveldb_include_start modification by MyCoolScript",
|
|
|
"PUBLIC",
|
|
|
"path1",
|
|
|
"path2",
|
|
|
@@ -132,7 +132,7 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
)
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
@@ -141,11 +141,11 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
|
|
|
self.assertSequenceEqual(patched_lines, [
|
|
|
"target_include_directories(leveldb\n",
|
|
|
- "# BEGIN: leveldb_include_start modification by MyCoolSript \n",
|
|
|
+ "# BEGIN: leveldb_include_start modification by MyCoolScript \n",
|
|
|
" PRIVATE \n",
|
|
|
" a/b \n",
|
|
|
" c/d \n",
|
|
|
- "# END: leveldb_include_start modification by MyCoolSript \n",
|
|
|
+ "# END: leveldb_include_start modification by MyCoolScript \n",
|
|
|
" PUBLIC \n",
|
|
|
" path1 \n",
|
|
|
" path2 \n",
|
|
|
@@ -166,7 +166,7 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
)
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
@@ -177,11 +177,11 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
"aaa",
|
|
|
"bbb",
|
|
|
"target_include_directories(leveldb",
|
|
|
- "# BEGIN: leveldb_include_start modification by MyCoolSript",
|
|
|
+ "# BEGIN: leveldb_include_start modification by MyCoolScript",
|
|
|
"PRIVATE",
|
|
|
"a/b",
|
|
|
"c/d",
|
|
|
- "# END: leveldb_include_start modification by MyCoolSript",
|
|
|
+ "# END: leveldb_include_start modification by MyCoolScript",
|
|
|
"PUBLIC",
|
|
|
"path1",
|
|
|
"path2",
|
|
|
@@ -196,7 +196,7 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
)
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
@@ -204,10 +204,10 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
patched_lines = tuple(patcher.patch())
|
|
|
|
|
|
self.assertSequenceEqual(patched_lines, [
|
|
|
- "# BEGIN: leveldb_snappy_link_line modification by MyCoolSript",
|
|
|
+ "# BEGIN: leveldb_snappy_link_line modification by MyCoolScript",
|
|
|
"# target_link_libraries(leveldb snappy)",
|
|
|
"target_link_libraries(leveldb Snappy::Snappy)",
|
|
|
- "# END: leveldb_snappy_link_line modification by MyCoolSript",
|
|
|
+ "# END: leveldb_snappy_link_line modification by MyCoolScript",
|
|
|
])
|
|
|
|
|
|
def test_leveldb_snappy_link_line_has_indent_and_eol_preserved(self):
|
|
|
@@ -216,7 +216,7 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
)
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
@@ -224,10 +224,10 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
patched_lines = tuple(patcher.patch())
|
|
|
|
|
|
self.assertSequenceEqual(patched_lines, [
|
|
|
- "# BEGIN: leveldb_snappy_link_line modification by MyCoolSript \n",
|
|
|
+ "# BEGIN: leveldb_snappy_link_line modification by MyCoolScript \n",
|
|
|
" # target_link_libraries(leveldb snappy) \n",
|
|
|
" target_link_libraries(leveldb Snappy::Snappy) \n",
|
|
|
- "# END: leveldb_snappy_link_line modification by MyCoolSript \n",
|
|
|
+ "# END: leveldb_snappy_link_line modification by MyCoolScript \n",
|
|
|
])
|
|
|
|
|
|
def test_leveldb_snappy_link_line_does_not_affect_surrounding_lines(self):
|
|
|
@@ -240,7 +240,7 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
)
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
@@ -250,10 +250,10 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
self.assertSequenceEqual(patched_lines, [
|
|
|
"aaa",
|
|
|
"bbb",
|
|
|
- "# BEGIN: leveldb_snappy_link_line modification by MyCoolSript",
|
|
|
+ "# BEGIN: leveldb_snappy_link_line modification by MyCoolScript",
|
|
|
"# target_link_libraries(leveldb snappy)",
|
|
|
"target_link_libraries(leveldb Snappy::Snappy)",
|
|
|
- "# END: leveldb_snappy_link_line modification by MyCoolSript",
|
|
|
+ "# END: leveldb_snappy_link_line modification by MyCoolScript",
|
|
|
"ccc",
|
|
|
"ddd",
|
|
|
])
|
|
|
@@ -270,30 +270,30 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
|
|
|
patcher = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
patched_lines = tuple(patcher.patch())
|
|
|
|
|
|
self.assertSequenceEqual(patched_lines, [
|
|
|
- "# BEGIN: snappy_detect_line modification by MyCoolSript",
|
|
|
+ "# BEGIN: snappy_detect_line modification by MyCoolScript",
|
|
|
"""# check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)""",
|
|
|
"""set(HAVE_SNAPPY ON CACHE BOOL "")""",
|
|
|
- "# END: snappy_detect_line modification by MyCoolSript",
|
|
|
+ "# END: snappy_detect_line modification by MyCoolScript",
|
|
|
"target_include_directories(leveldb",
|
|
|
- "# BEGIN: leveldb_include_start modification by MyCoolSript",
|
|
|
+ "# BEGIN: leveldb_include_start modification by MyCoolScript",
|
|
|
"PRIVATE",
|
|
|
"a/b",
|
|
|
"c/d",
|
|
|
- "# END: leveldb_include_start modification by MyCoolSript",
|
|
|
+ "# END: leveldb_include_start modification by MyCoolScript",
|
|
|
"PUBLIC",
|
|
|
"path1",
|
|
|
")",
|
|
|
- "# BEGIN: leveldb_snappy_link_line modification by MyCoolSript",
|
|
|
+ "# BEGIN: leveldb_snappy_link_line modification by MyCoolScript",
|
|
|
"# target_link_libraries(leveldb snappy)",
|
|
|
"target_link_libraries(leveldb Snappy::Snappy)",
|
|
|
- "# END: leveldb_snappy_link_line modification by MyCoolSript",
|
|
|
+ "# END: leveldb_snappy_link_line modification by MyCoolScript",
|
|
|
])
|
|
|
|
|
|
def test_idempotence(self):
|
|
|
@@ -308,14 +308,14 @@ class CMakeListsPatcherTest(unittest.TestCase):
|
|
|
|
|
|
patcher1 = leveldb_patch.CMakeListsPatcher(
|
|
|
lines,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|
|
|
patched_lines1 = tuple(patcher1.patch())
|
|
|
patcher2 = leveldb_patch.CMakeListsPatcher(
|
|
|
patched_lines1,
|
|
|
- script_name="MyCoolSript",
|
|
|
+ script_name="MyCoolScript",
|
|
|
snappy_source_dir=pathlib.Path("a/b"),
|
|
|
snappy_binary_dir=pathlib.Path("c/d"),
|
|
|
)
|