Skip to content

Commit

Permalink
Add unit test for #1941 (recursive data structures). Closes #1941.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Dec 21, 2017
1 parent ad64494 commit 5071ea1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data/vibe/data/serialization.d
Expand Up @@ -1918,6 +1918,16 @@ unittest {
assert(deser.bar_ == 42);
}

@safe unittest { // issue 1941
static struct Bar { Bar[] foos; int i; }
Bar b1 = {[{null, 2}], 1};
auto s = serialize!TestSerializer(b1);
auto b = deserialize!(TestSerializer, Bar)(s);
assert(b.i == 1);
assert(b.foos.length == 1);
assert(b.foos[0].i == 2);
}

unittest { // issue 1991 - @system property getters/setters does not compile
static class A {
@property @name("foo") {
Expand Down

0 comments on commit 5071ea1

Please sign in to comment.