From e181f873a578848ff7e8a45eda260a729390394f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 13:08:36 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Add=20tests=20for=20minify=20fun?= =?UTF-8?q?ction=20in=20compress.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: dioncx <148190661+dioncx@users.noreply.github.com> --- tests/test_json_memory.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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