def test_json_unpack_compat():
    """Test reading old json with serialized measurements array."""
    old_json = """
        {
            "cirq_type": "ResultDict",
            "params": {
                "cirq_type": "ParamResolver",
                "param_dict": []
            },
            "measurements": {
                "m": {
                    "packed_digits": "d32a",
                    "binary": true,
                    "dtype": "bool",
                    "shape": [
                        3,
                        5
                    ]
                }
            }
        }
    """
    result = cirq.read_json(json_text=old_json)
    assert result == cirq.ResultDict(
        params=cirq.ParamResolver({}),
        measurements={
            'm': np.array(
                [
                    [True, True, False, True, False],
                    [False, True, True, False, False],
                    [True, False, True, False, True],
                ],
                dtype=bool,
            )
        },
    )
Test reading old json with serialized measurements array.
cirq-core/cirq/study/result_test.py