diff --git a/tests/test_json_memory.py b/tests/test_json_memory.py index 1118e7a..88d7be4 100644 --- a/tests/test_json_memory.py +++ b/tests/test_json_memory.py @@ -3,6 +3,7 @@ import json import pytest from json_memory import Memory, Synapse, Schema, WeightGate, compress, decompress, savings_report +from json_memory.compress import minify # -- Memory Tests -------------------------------------------------- @@ -435,6 +436,17 @@ def test_decompress_roundtrip(self): decompressed = decompress(compressed) assert decompressed == original + + def test_minify(self): + json_str = '{\n "key": "value",\n "hello": "world"\n}' + minified = minify(json_str) + assert minified == '{"key":"value","hello":"world"}' + + # Test ensure_ascii=False + json_with_unicode = '{\n "key": "✓"\n}' + minified_unicode = minify(json_with_unicode) + assert minified_unicode == '{"key":"✓"}' + def test_savings_report(self): report = savings_report("hello world", "hw") assert report["original_chars"] == 11