Compare commits

...

2 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire bf0d9569c6 Merge branch 'master' into feature/tree 2024-04-27 16:51:01 +02:00
Tristan B. Velloza Kildaire c7825c5821 niknaks.arrays (unittest)
- Added a unittest
2024-04-27 16:49:57 +02:00
1 changed files with 13 additions and 0 deletions

View File

@ -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]);
}