1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-02 09:17:19 -04:00
OpenDiablo2/d2common/d2fileformats/d2dt1/subtile_test.go
Tim Sarbin 2461142fbd
Minor changes to project layout (#276)
* Minor changes to reduce interdependencies on modules.
2020-01-31 23:18:11 -05:00

25 lines
568 B
Go

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)
}
}