mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 06:57:28 +02:00
test getAll for empty palette
This commit is contained in:
parent
1556bf8586
commit
703255e786
@ -139,6 +139,14 @@ public class PaletteTest {
|
||||
var palettes = testPalettes();
|
||||
for (Palette palette : palettes) {
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
|
||||
// Ensure that the lambda is called for every entry
|
||||
// even if the array is initialized
|
||||
palette.getAll((x, y, z, value) -> count.getAndIncrement());
|
||||
assertEquals(count.get(), palette.maxSize());
|
||||
|
||||
// Fill all entries
|
||||
count.set(0);
|
||||
palette.setAll((x, y, z) -> {
|
||||
count.getAndIncrement();
|
||||
return x + y + z + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user