pyhcl
pyhcl copied to clipboard
Add failing structure_list2 decoder test
Test passes if added into official https://github.com/hashicorp/hcl decoder test.
What pyhcl makes is obviously wrong:
{'top': [{'a': 'a', 'b': 'b', 'c': 'c'}, {'b': 'b'}]} != {'top': [{'a': 'a', 'b': 'b'}, {'b': 'b', 'c': 'c'}]}
No solution yet, but looks like the problematic code was added in 46a4138d11480c159fb6bd2442f733bbdf11a470
The code erroneously adds 'c' into the first dictionary, but then discovers 'b' that already exists and extends the list, so the 'c' key appears moved to the first dictionary.
Travis CI will likely fail this one, but please merge it in.
If someone pushes a PR to fix the failing test, I'm happy to merge it. I'll keep the PR open, but I don't personally have bandwidth to address it. Maybe @scottbelden ?
Fixed structure_list2 test with a fairly straightforward fix, but added structure_list3