MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_unicode_content

Function test_unicode_content

tests/test-key-value-store.py:162–180  ·  view source on GitHub ↗

Test Unicode characters in keys and values

(name)

Source from the content-addressed store, hash-verified

160 results.fail("key2 lookup", "value2", v2)
161
162def test_unicode_content(name):
163 """Test Unicode characters in keys and values"""
164 print("\n[Test: Unicode Content]")
165
166 test_cases = [
167 ("emoji_key_🔑", "emoji_value_🎉"),
168 ("chinese_key_中文", "chinese_value_你好世界"),
169 ("arabic_مفتاح", "arabic_قيمة"),
170 ("mixed_αβγ_123", "Ω_ñ_ü_∞"),
171 ]
172
173 run_in_txn(name, lambda t: [upsert(name, t, k, v) for k, v in test_cases])
174
175 for key, expected in test_cases:
176 actual = lookup(name, key)
177 if actual == expected:
178 results.ok(f"unicode: {key[:20]}")
179 else:
180 results.fail(f"unicode: {key[:20]}", expected, actual)
181
182def test_special_characters(name):
183 """Test special characters and escape sequences"""

Callers 1

mainFunction · 0.85

Calls 5

run_in_txnFunction · 0.85
okMethod · 0.80
failMethod · 0.80
upsertFunction · 0.70
lookupFunction · 0.70

Tested by

no test coverage detected