neon-py
neon-py copied to clipboard
Dictionary of unindented elements is not recognized
NEON_DICT_OF_LISTS = """
key:
- "elem"
"""
def test_squeezed_dict_of_lists():
assert neon.decode(NEON_DICT_OF_LISTS) == {"key":["elem"]}
Expected to be valid PHP
array (1)
'key' => array (1)
0 => 'elem'
NEON_INDENTED_DICT_OF_LISTS = """
root:
key:
- "elem"
"""
def test_indented_squeezed_dict_of_lists():
assert neon.decode(NEON_INDENTED_DICT_OF_LISTS) == {"root":{"key":["elem"]}}
Expected to be valid PHP
array (1)
'root' => array (1)
'key' => array (1)
Although I am not sure if that is a valid Neon, or just a leniency of PHP Neon implementation