mirror of
https://github.com/dlang/phobos.git
synced 2025-05-08 03:56:54 +03:00
Merge pull request #4705 from wilzbach/test_alloc
[trivial] Extend reallocate test for all Allocators
This commit is contained in:
commit
accf8d540e
1 changed files with 3 additions and 0 deletions
|
@ -407,6 +407,7 @@ Forwards each of the methods in `funs` (if defined) to `member`.
|
|||
return result;
|
||||
}
|
||||
|
||||
version(unittest)
|
||||
package void testAllocator(alias make)()
|
||||
{
|
||||
import std.conv : text;
|
||||
|
@ -492,6 +493,8 @@ package void testAllocator(alias make)()
|
|||
assert(b6.length == 0);
|
||||
assert(a.reallocate(b6, 1));
|
||||
assert(b6.length == 1, text(b6.length));
|
||||
assert(a.reallocate(b6, 2));
|
||||
assert(b6.length == 2);
|
||||
|
||||
// Test owns
|
||||
static if (hasMember!(A, "owns"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue