Skip to content

Commit

Permalink
Verify that json array append does not alias the original array
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarp committed Aug 24, 2014
1 parent 3745de6 commit 0374afa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions std/json.d
Expand Up @@ -1060,6 +1060,11 @@ unittest
foreach (i; 0..9)
jobj[text("key", i)] = JSONValue(text("value", i));
assert(jobj.object.length == 10);

// No array alias
auto jarr2 = jarr ~ [1,2,3];
jarr2[0] = 999;
assert(jarr[0] == JSONValue(10));
}

unittest
Expand Down

0 comments on commit 0374afa

Please sign in to comment.