Skip to content
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
23 changes: 15 additions & 8 deletions breezy/bzr/tests/test_inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,14 +980,21 @@ def test_make_entry(self):
def test_make_entry_non_normalized(self):
from bzrformats.errors import InvalidNormalization

# bzrformats rejects un-normalized names at construction time.
self.assertRaises(
InvalidNormalization,
inventory.make_entry,
"file",
"a\u030a",
ROOT_ID,
)
if osutils.normalizes_filenames():
# On platforms that normalize filenames (e.g. macOS), the
# decomposed form is accepted and normalized to NFC.
entry = inventory.make_entry("file", "a\u030a", ROOT_ID)
self.assertEqual("\xe5", entry.name)
self.assertIsInstance(entry, inventory.InventoryFile)
else:
# Elsewhere, bzrformats rejects un-normalized names.
self.assertRaises(
InvalidNormalization,
inventory.make_entry,
"file",
"a\u030a",
ROOT_ID,
)
# Already-normalized names are accepted.
entry = inventory.make_entry("file", "\xe5", ROOT_ID)
self.assertEqual("\xe5", entry.name)
Expand Down
Loading