Source

cffi / testing / test_platform.py

Diff from to

testing/test_platform.py

     assert maybe_relative_path(p) == 'baz.py'
     foobaz = os.path.join('foo', 'baz.py')
     assert maybe_relative_path(os.path.abspath(foobaz)) == foobaz
+
+def test_flatten():
+    assert flatten("foo") == "3sfoo"
+    assert flatten(-10000000000000000000000000000) == \
+           "-10000000000000000000000000000i"
+    assert flatten([4, 5]) == "2l4i5i"
+    assert flatten({4: 5}) == "1d4i5i"
+    assert flatten({"foo": ("bar", "baaz")}) == "1d3sfoo2l3sbar4sbaaz"