pyhcl icon indicating copy to clipboard operation
pyhcl copied to clipboard

Add failing structure_list2 decoder test

Open link2xt opened this issue 8 years ago • 2 comments
trafficstars

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.

link2xt avatar Jan 31 '17 19:01 link2xt

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 ?

virtuald avatar Jan 31 '17 21:01 virtuald

Fixed structure_list2 test with a fairly straightforward fix, but added structure_list3

link2xt avatar Feb 02 '17 02:02 link2xt