mirror of https://github.com/deavmi/niknaks
parent
6b12529ec3
commit
c7825c5821
|
@ -469,4 +469,17 @@ unittest
|
|||
public T[] removeResize(T)(T[] array, size_t position)
|
||||
{
|
||||
return array.shiftInto(position, false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests removing an element from an array
|
||||
*/
|
||||
unittest
|
||||
{
|
||||
int[] numbas = [1, 5, 2];
|
||||
numbas = numbas.removeResize(1);
|
||||
|
||||
// should now be [1, 2]
|
||||
writeln(numbas);
|
||||
assert(numbas == [1, 2]);
|
||||
}
|
Loading…
Reference in New Issue