Try to fix palette resizing

This commit is contained in:
2022-11-20 21:16:53 +08:00
parent 3e83d1dbca
commit 6e597fe4f8
2 changed files with 23 additions and 5 deletions

18
level/palette_test.go Normal file
View File

@ -0,0 +1,18 @@
package level
import (
"testing"
)
func TestPaletteResize(t *testing.T) {
container := NewStatesPaletteContainer(16*16*16, 0)
for i := 0; i < 4096; i++ {
container.Set(i, BlocksState(i))
}
for i := 0; i < 4096; i++ {
if container.Get(i) != BlocksState(i) {
t.Errorf("Get Error, got: %v,but expect: %v", container.Get(i), BlocksState(i))
}
}
}