Skip to content

Conversation

@zzantozz
Copy link

Existing handling of setting array indexes has a couple of issues. First, it calls a non-existent lists:append/3 in a couple of places. It also mishandles setting the first element of an array greater than length one. This adds tests that cover the problem spots in the code and fixes the problems.

Problem behavior before this change can be seen in

> props:set("a[1].b", 2, {[{<<"a">>, [{[{<<"b">>, 1}]}]}]}).
** exception error: undefined function lists:append/3
     in function  props:do_set/3 (/vagrant/lib/props/src/props.erl, line 176)

and

> props:set("a[1]", 2, {[{<<"a">>, [4,5,6]}]}).
{[{<<"a">>,[2,6]}]}

Existing handling of setting array indexes has a couple of issues. First, it calls a non-existent lists:append/3 in a couple
of places. It also mishandles setting the first element of an array greater than length one. This adds tests that cover the
problem spots in the code and fixes the problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant