- Added a unittest for `isPresent!(T)(T[] values, T value)`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-25 22:16:38 +02:00
parent 1408a5c202
commit 1986202309
1 changed files with 11 additions and 0 deletions

View File

@ -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;