mirror of https://github.com/deavmi/doap
Utils
- Added a unittest for `isPresent!(T)(T[] values, T value)`
This commit is contained in:
parent
1408a5c202
commit
1986202309
|
@ -120,6 +120,17 @@ public bool isPresent(T)(T[] array, T value)
|
|||
}
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
ubyte[] values = [1,2,3];
|
||||
foreach(ubyte value; values)
|
||||
{
|
||||
assert(isPresent(values, value));
|
||||
}
|
||||
assert(isPresent(values, 0) == false);
|
||||
assert(isPresent(values, 5) == false);
|
||||
}
|
||||
|
||||
public T findNextFree(T)(T[] used) if(__traits(isIntegral, T))
|
||||
{
|
||||
T found;
|
||||
|
|
Loading…
Reference in New Issue