Skip to content

Commit 7460a93

Browse files
committed
fix: make case sensitivity test platform-aware
- Add platform detection to handle case-insensitive file systems - Test now passes on macOS and Windows while maintaining Linux behavior - Fixes test failure on case-insensitive file systems
1 parent 43fa576 commit 7460a93

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

tests/sync/test_character_conflicts.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ async def test_case_sensitivity_conflict(
224224
entity_repository: EntityRepository,
225225
):
226226
"""Test conflict handling when case differences cause issues."""
227+
import platform
228+
227229
project_dir = project_config.home
228230

229231
# Create directory structure that might cause case conflicts
@@ -254,12 +256,22 @@ async def test_case_sensitivity_conflict(
254256

255257
# Verify entities were created
256258
entities = await entity_repository.find_all()
257-
assert len(entities) >= 2 # Allow for potential other test files
258-
259-
# Check that file paths are preserved correctly
260-
file_paths = [entity.file_path for entity in entities]
261-
assert "Finance/investment.md" in file_paths
262-
assert "finance/investment.md" in file_paths
259+
260+
# On case-insensitive file systems (macOS, Windows), only one entity will be created
261+
# On case-sensitive file systems (Linux), two entities will be created
262+
if platform.system() in ["Darwin", "Windows"]:
263+
# Case-insensitive file systems
264+
assert len(entities) >= 1
265+
# Only one of the paths will exist
266+
file_paths = [entity.file_path for entity in entities]
267+
assert any(path in ["Finance/investment.md", "finance/investment.md"] for path in file_paths)
268+
else:
269+
# Case-sensitive file systems (Linux)
270+
assert len(entities) >= 2
271+
# Check that file paths are preserved correctly
272+
file_paths = [entity.file_path for entity in entities]
273+
assert "Finance/investment.md" in file_paths
274+
assert "finance/investment.md" in file_paths
263275

264276
async def test_move_conflict_resolution(
265277
self,

0 commit comments

Comments
 (0)