Skip to content

Commit

Permalink
Add comments to emplace unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-sh committed Oct 27, 2012
1 parent 2840e44 commit 10375d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions std/conv.d
Expand Up @@ -3553,6 +3553,8 @@ T* emplace(T, Args...)(T* chunk, auto ref Args args)
return chunk;
}

// Test constructor branch

unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
Expand Down Expand Up @@ -3589,6 +3591,8 @@ unittest
assert(var == 7);
}

// Test matching fields branch

unittest
{
struct Foo
Expand All @@ -3601,6 +3605,10 @@ unittest
assert(foo.num == 2);
}

// Test assignment branch

// FIXME: no tests

private void testEmplaceChunk(void[] chunk, size_t typeSize, size_t typeAlignment, string typeName)
{
enforceEx!ConvException(chunk.length >= typeSize,
Expand Down

0 comments on commit 10375d6

Please sign in to comment.