Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: a repeated typo in python file #13839

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions cmake/external/leveldb_patch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_snappy_include_is_amended(self):
)
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"),
)
Expand All @@ -111,11 +111,11 @@ def test_snappy_include_is_amended(self):

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",
Expand All @@ -132,7 +132,7 @@ def test_snappy_include_lines_adopt_indenting_and_eol_convention(self):
)
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"),
)
Expand All @@ -141,11 +141,11 @@ def test_snappy_include_lines_adopt_indenting_and_eol_convention(self):

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",
Expand All @@ -166,7 +166,7 @@ def test_snappy_include_line_does_not_affect_surrounding_lines(self):
)
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"),
)
Expand All @@ -177,11 +177,11 @@ def test_snappy_include_line_does_not_affect_surrounding_lines(self):
"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",
Expand All @@ -196,18 +196,18 @@ def test_leveldb_snappy_link_line_is_commented_and_replaced(self):
)
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: 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):
Expand All @@ -216,18 +216,18 @@ def test_leveldb_snappy_link_line_has_indent_and_eol_preserved(self):
)
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: 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):
Expand All @@ -240,7 +240,7 @@ def test_leveldb_snappy_link_line_does_not_affect_surrounding_lines(self):
)
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"),
)
Expand All @@ -250,10 +250,10 @@ def test_leveldb_snappy_link_line_does_not_affect_surrounding_lines(self):
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",
])
Expand All @@ -270,30 +270,30 @@ def test_all_patches_combined(self):

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):
Expand All @@ -308,14 +308,14 @@ def test_idempotence(self):

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"),
)
Expand Down
Loading