Skip to content

Commit 85a5aa6

Browse files
committed
adding test for nested assocs
1 parent ec389c6 commit 85a5aa6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

wolframclient/tests/deserializers/wxf_deserialize.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from wolframclient.tests.configure import skip_for_jython
1919
from wolframclient.utils import six
2020
from wolframclient.utils.api import numpy
21+
from wolframclient.utils.datastructures import immutabledict
2122
from wolframclient.utils.tests import TestCase as BaseTestCase
2223

23-
2424
class TestCase(BaseTestCase):
2525
def test_token_dimensions(self):
2626
token = WXFToken(None)
@@ -199,6 +199,13 @@ def test_compressed_input(self):
199199
res = binary_deserialize(wxf, consumer=WXFConsumer())
200200
self.assertEqual(expr, res)
201201

202+
def test_nested_associations(self):
203+
expr = immutabledict((('a', 2), ('a', 3)))
204+
expr = immutabledict(((expr, expr), (2, 3)))
205+
wxf = export(expr, target_format="wxf", compress=True)
206+
res = binary_deserialize(wxf, consumer=WXFConsumer())
207+
self.assertEqual(expr, res)
208+
202209
# Custom consumers
203210
class BadGreedyConsumer(WXFConsumer):
204211
def consume_function(self, current_token, tokens, **kwargs):

0 commit comments

Comments
 (0)