1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-17 09:56:07 -05:00
OpenDiablo2/d2common/d2fileformats/d2dt1/subtile_test.go

25 lines
568 B
Go
Raw Normal View History

package d2dt1
import (
testify "github.com/stretchr/testify/assert"
"testing"
)
func TestNewSubTile(t *testing.T) {
assert := testify.New(t)
data := []byte{1, 2, 4, 8, 16, 32, 64, 128}
for i, b := range data {
tile := NewSubTileFlags(b)
assert.Equal(i == 0, tile.BlockWalk)
assert.Equal(i == 1, tile.BlockLOS)
assert.Equal(i == 2, tile.BlockJump)
assert.Equal(i == 3, tile.BlockPlayerWalk)
assert.Equal(i == 4, tile.Unknown1)
assert.Equal(i == 5, tile.BlockLight)
assert.Equal(i == 6, tile.Unknown2)
assert.Equal(i == 7, tile.Unknown3)
}
}